提交 e3eeacba 编写于 作者: F Florian Westphal 提交者: Pablo Neira Ayuso

netfilter: x_tables: don't return garbage pointer on modprobe failure

request_module may return a positive error result from modprobe,
if we cast this to ERR_PTR this returns a garbage result (it passes
IS_ERR checks).

Fix it by ignoring modprobe return values entirely, just retry the
table lookup instead.

Reported-by: syzbot+980925dbfbc7f93bc2ef@syzkaller.appspotmail.com
Fixes: 03d13b68 ("netfilter: xtables: add and use xt_request_find_table_lock")
Fixes: 20651cef ("netfilter: x_tables: unbreak module auto loading")
Signed-off-by: NFlorian Westphal <fw@strlen.de>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 9be9d04b
......@@ -1085,7 +1085,7 @@ struct xt_table *xt_request_find_table_lock(struct net *net, u_int8_t af,
#ifdef CONFIG_MODULES
if (IS_ERR(t)) {
int err = request_module("%stable_%s", xt_prefix[af], name);
if (err)
if (err < 0)
return ERR_PTR(err);
t = xt_find_table_lock(net, af, name);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册