Thread (4 messages) flat view 4 messages, 3 authors, 2021-08-11

Re: [PATCH v2] netfilter: protect nft_ct_pcpu_template_refcnt with mutex

From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: 2021-08-11 09:22:12
Also in: lkml, netfilter-devel

On Tue, Aug 10, 2021 at 03:59:20PM +0300, Pavel Skripkin 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.
Applied to nf.git, thanks
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help