]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
netfilter: flowtable_offload: add missing locking
authorFelix Fietkau <nbd@nbd.name>
Mon, 21 Nov 2022 18:26:15 +0000 (19:26 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 14 Dec 2022 13:00:28 +0000 (14:00 +0100)
commit111469cdc15d4d49c2d1c88a09d7dd31ae1198ad
tree1241dce2065b776d1d6c4507aee5ed0d926acf6a
parent818a5d693d0fcc6f95976252739eab1ce26325f7
netfilter: flowtable_offload: add missing locking

[ Upstream commit bcd9e3c1656d0f7dd9743598c65c3ae24efb38d0 ]

nf_flow_table_block_setup and the driver TC_SETUP_FT call can modify the flow
block cb list while they are being traversed elsewhere, causing a crash.
Add a write lock around the calls to protect readers

Fixes: c29f74e0df7a ("netfilter: nf_flow_table: hardware offload support")
Reported-by: Chad Monroe <chad.monroe@smartrg.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 8db9e60cdfdae5b049e32e82323da8f0f989066a)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
net/netfilter/nf_flow_table_offload.c