netfilter: nf_tables: use READ_ONCE and WRITE_ONCE for shared generation id access
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 9 Aug 2022 11:22:01 +0000 (13:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:40:21 +0000 (11:40 +0200)
commit8a38a73cb406eedadee53ebc2787aa62edc04abf
treef40271ab314fb2d363f7fa67a3d98efd1cb9b5c7
parentcacdddfefe8d69eeaf1b1cea9012e4158d9a5728
netfilter: nf_tables: use READ_ONCE and WRITE_ONCE for shared generation id access

commit 3400278328285a8c2f121904496aff5e7b610a01 upstream.

The generation ID is bumped from the commit path while holding the
mutex, however, netlink dump operations rely on RCU.

This patch also adds missing cb->base_eq initialization in
nf_tables_dump_set().

Fixes: 38e029f14a97 ("netfilter: nf_tables: set NLM_F_DUMP_INTR if netlink dumping is stale")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nf_tables_api.c