]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netpoll: hold rcu read lock in __netpoll_send_skb()
authorBreno Leitao <leitao@debian.org>
Thu, 6 Mar 2025 13:16:18 +0000 (05:16 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:31:49 +0000 (14:31 +0200)
commitb018706f5fdba7ef193c34462f5935ca47cb0b7a
tree4057dd9f5b72671390c8eac3a3af2da6d372ddf4
parent7274119e8128d2ddf44de5601447b92693a8bc08
netpoll: hold rcu read lock in __netpoll_send_skb()

[ Upstream commit 505ead7ab77f289f12d8a68ac83da068e4d4408b ]

The function __netpoll_send_skb() is being invoked without holding the
RCU read lock. This oversight triggers a warning message when
CONFIG_PROVE_RCU_LIST is enabled:

net/core/netpoll.c:330 suspicious rcu_dereference_check() usage!

 netpoll_send_skb
 netpoll_send_udp
 write_ext_msg
 console_flush_all
 console_unlock
 vprintk_emit

To prevent npinfo from disappearing unexpectedly, ensure that
__netpoll_send_skb() is protected with the RCU read lock.

Fixes: 2899656b494dcd1 ("netpoll: take rcu_read_lock_bh() in netpoll_send_skb_on_dev()")
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250306-netpoll_rcu_v2-v2-1-bc4f5c51742a@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/netpoll.c