[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210810132248.GS607@breakpoint.cc>
Date: Tue, 10 Aug 2021 15:22:48 +0200
From: Florian Westphal <fw@...len.de>
To: Pavel Skripkin <paskripkin@...il.com>
Cc: pablo@...filter.org, kadlec@...filter.org, fw@...len.de,
davem@...emloft.net, netfilter-devel@...r.kernel.org,
coreteam@...filter.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
syzbot+649e339fa6658ee623d3@...kaller.appspotmail.com
Subject: Re: [PATCH v2] netfilter: protect nft_ct_pcpu_template_refcnt with
mutex
Pavel Skripkin <paskripkin@...il.com> wrote:
> Syzbot hit use-after-free in nf_tables_dump_sets. The problem was in
> missing lock protection for nft_ct_pcpu_template_refcnt.
>
> Before commit f102d66b335a ("netfilter: nf_tables: use dedicated
> mutex to guard transactions") all transactions were serialized by global
> mutex, but then global mutex was changed to local per netnamespace
> commit_mutex.
>
> This change causes use-after-free bug, when 2 netnamespaces concurently
> changing nft_ct_pcpu_template_refcnt without proper locking. Fix it by
> adding nft_ct_pcpu_mutex and protect all nft_ct_pcpu_template_refcnt
> changes with it.
>
> Fixes: f102d66b335a ("netfilter: nf_tables: use dedicated mutex to guard transactions")
> Reported-and-tested-by: syzbot+649e339fa6658ee623d3@...kaller.appspotmail.com
> Signed-off-by: Pavel Skripkin <paskripkin@...il.com>
Acked-by: Florian Westphal <fw@...len.de>
Powered by blists - more mailing lists