lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221103131829.GB29268@breakpoint.cc>
Date:   Thu, 3 Nov 2022 14:18:29 +0100
From:   Florian Westphal <fw@...len.de>
To:     Shigeru Yoshida <syoshida@...hat.com>
Cc:     pablo@...filter.org, kadlec@...filter.org, fw@...len.de,
        netfilter-devel@...r.kernel.org, coreteam@...filter.org,
        linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com,
        syzbot+178efee9e2d7f87f5103@...kaller.appspotmail.com
Subject: Re: [PATCH] netfilter: Cleanup nft_net->module_list from
 nf_tables_exit_net()

Shigeru Yoshida <syoshida@...hat.com> wrote:
> syzbot reported a warning like below [1]:
> 
> This patch fixes this issue by calling __nf_tables_abort() when
> nft_net->module_list is not empty in nf_tables_exit_net().

Fixes: eb014de4fd41 ("netfilter: nf_tables: autoload modules from the abort path")

> diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
> index 58d9cbc9ccdc..a7579d16f59f 100644
> --- a/net/netfilter/nf_tables_api.c
> +++ b/net/netfilter/nf_tables_api.c
> @@ -10088,7 +10088,8 @@ static void __net_exit nf_tables_exit_net(struct net *net)
>  	struct nftables_pernet *nft_net = nft_pernet(net);
>  
>  	mutex_lock(&nft_net->commit_mutex);
> -	if (!list_empty(&nft_net->commit_list))
> +	if (!list_empty(&nft_net->commit_list) ||
> +	    !list_empty(&nft_net->module_list))
>  		__nf_tables_abort(net, NFNL_ABORT_NONE);

Maybe just an unconditionall call to nf_tables_module_autoload_cleanup().

Or, alternatively, unconditionally call __nf_tables_abort().
The downside is that we will need to change __nf_tables_abort to elide
synchronize_rcu() unless needed -- else netns dismantling might become
too expensive.

OTOH, module_list should always be empty here, so this is ok.

Reviewed-by: Florian Westphal <fw@...len.de>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ