]> www.infradead.org Git - users/willy/pagecache.git/commit
ndisc: extend RCU protection in ndisc_send_skb()
authorEric Dumazet <edumazet@google.com>
Fri, 7 Feb 2025 13:58:39 +0000 (13:58 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 11 Feb 2025 02:09:10 +0000 (18:09 -0800)
commited6ae1f325d3c43966ec1b62ac1459e2b8e45640
tree7811577d8c7988e92c0095ef6ea27cd02a6b0f2b
parent6d0ce46a93135d96b7fa075a94a88fe0da8e8773
ndisc: extend RCU protection in ndisc_send_skb()

ndisc_send_skb() can be called without RTNL or RCU held.

Acquire rcu_read_lock() earlier, so that we can use dev_net_rcu()
and avoid a potential UAF.

Fixes: 1762f7e88eb3 ("[NETNS][IPV6] ndisc - make socket control per namespace")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20250207135841.1948589-8-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv6/ndisc.c