]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: make table handle allocation per-netns friendly
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 21 Aug 2022 08:52:48 +0000 (10:52 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 24 Aug 2022 05:43:20 +0000 (07:43 +0200)
commitb3be30e74428cb2e2969deecc2e0e2d9a0416276
tree545fbbbdacb5e42167d96abbb877cf15f0ef26a7
parent91987f389130873d0254d4ba984af2c7e22e1f32
netfilter: nf_tables: make table handle allocation per-netns friendly

mutex is per-netns, move table_netns to the pernet area.

*read-write* to 0xffffffff883a01e8 of 8 bytes by task 6542 on cpu 0:
 nf_tables_newtable+0x6dc/0xc00 net/netfilter/nf_tables_api.c:1221
 nfnetlink_rcv_batch net/netfilter/nfnetlink.c:513 [inline]
 nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:634 [inline]
 nfnetlink_rcv+0xa6a/0x13a0 net/netfilter/nfnetlink.c:652
 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
 netlink_unicast+0x652/0x730 net/netlink/af_netlink.c:1345
 netlink_sendmsg+0x643/0x740 net/netlink/af_netlink.c:1921

Fixes: 6dc5aec035e7 ("netfilter: nf_tables: use dedicated mutex to guard transactions")
Reported-by: Abhishek Shah <abhishek.shah@columbia.edu>
Reviewed-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_tables.h
net/netfilter/nf_tables_api.c