[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241024062519.GA16685@breakpoint.cc>
Date: Thu, 24 Oct 2024 08:25:19 +0200
From: Florian Westphal <fw@...len.de>
To: Dong Chenchen <dongchenchen2@...wei.com>
Cc: pablo@...filter.org, kadlec@...filter.org, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
fw@...len.de, kuniyu@...zon.com, netfilter-devel@...r.kernel.org,
netdev@...r.kernel.org, yuehaibing@...wei.com
Subject: Re: [PATCH net v2] net: netfilter: Fix use-after-free in get_info()
Dong Chenchen <dongchenchen2@...wei.com> wrote:
> While xt_table module was going away and has been removed from
> xt_templates list, we couldnt get refcnt of xt_table->me. Check
> module in xt_net->tables list re-traversal to fix it.
>
> Fixes: fdacd57c79b7 ("netfilter: x_tables: never register tables by default")
> Signed-off-by: Dong Chenchen <dongchenchen2@...wei.com>
> ---
> net/netfilter/x_tables.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
> index da5d929c7c85..709840612f0d 100644
> --- a/net/netfilter/x_tables.c
> +++ b/net/netfilter/x_tables.c
> @@ -1269,7 +1269,7 @@ struct xt_table *xt_find_table_lock(struct net *net, u_int8_t af,
>
> /* and once again: */
> list_for_each_entry(t, &xt_net->tables[af], list)
> - if (strcmp(t->name, name) == 0)
> + if (strcmp(t->name, name) == 0 && owner == t->me)
> return t;
LGTM, thanks.
Reviewed-by: Florian Westphal <fw@...len.de>
Powered by blists - more mailing lists