netfilter: flowtable_offload: add missing locking
authorFelix Fietkau <nbd@nbd.name>
Mon, 21 Nov 2022 18:26:15 +0000 (19:26 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 22 Nov 2022 21:17:12 +0000 (22:17 +0100)
commitbcd9e3c1656d0f7dd9743598c65c3ae24efb38d0
treeb3503770b7ed644c786a86fa12a7247ffd81c0b7
parent6a66ce44a51bdfc47721f0c591137df2d4b21247
netfilter: flowtable_offload: add missing locking

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>
net/netfilter/nf_flow_table_offload.c