]> Gentwo Git Trees - linux/.git/commit
octeontx2-pf: Fix potential use after free in otx2_tc_add_flow()
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 23 Sep 2025 11:19:11 +0000 (14:19 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 25 Sep 2025 09:04:34 +0000 (11:04 +0200)
commitd9c70e93ec5988ab07ad2a92d9f9d12867f02c56
treef13a150e7a8c504398dc442f85f38bbaf2e25ce2
parent764a47a639c73e8d941cbbb10696a0eb98d10d7b
octeontx2-pf: Fix potential use after free in otx2_tc_add_flow()

This code calls kfree_rcu(new_node, rcu) and then dereferences "new_node"
and then dereferences it on the next line.  Two lines later, we take
a mutex so I don't think this is an RCU safe region.  Re-order it to do
the dereferences before queuing up the free.

Fixes: 68fbff68dbea ("octeontx2-pf: Add police action for TC flower")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Link: https://patch.msgid.link/aNKCL1jKwK8GRJHh@stanley.mountain
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c