]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
flow_dissector: use RCU protection to fetch dev_net()
authorEric Dumazet <edumazet@google.com>
Wed, 5 Feb 2025 15:51:17 +0000 (15:51 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 12:50:07 +0000 (13:50 +0100)
commitd13d8a3486ae4fc0959b8e61d561028856461713
tree9b9352c8bad844e11343a3b9ca074c12bcfc0eaf
parent85a1d9b0b43fad41ecc84a4311c90ed6f688e419
flow_dissector: use RCU protection to fetch dev_net()

[ Upstream commit afec62cd0a4191cde6dd3a75382be4d51a38ce9b ]

__skb_flow_dissect() can be called from arbitrary contexts.

It must extend its RCU protection section to include
the call to dev_net(), which can become dev_net_rcu().

This makes sure the net structure can not disappear under us.

Fixes: 9b52e3f267a6 ("flow_dissector: handle no-skb use case")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20250205155120.1676781-10-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/flow_dissector.c