]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 7 Oct 2022 08:39:24 +0000 (10:39 +0200)
commit7059866569c82a21938f09a151b829df418e823c
tree4164a927c18bcdb4e094319a48cf378c32364dc6
parent64f2d96697b8778b56a505399c399813a0e8baca
netfilter: nf_tables: make table handle allocation per-netns friendly

BugLink: https://bugs.launchpad.net/bugs/1991717
[ Upstream commit ab482c6b66a4a8c0a8c0b0f577a785cf9ff1c2e2 ]

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: f102d66b335a ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
include/net/netfilter/nf_tables.h
net/netfilter/nf_tables_api.c