]> www.infradead.org Git - users/willy/pagecache.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)
committerJakub Kicinski <kuba@kernel.org>
Sat, 8 Mar 2025 03:57:33 +0000 (19:57 -0800)
commit505ead7ab77f289f12d8a68ac83da068e4d4408b
tree2adfcc0791444ce67dbd7288931a83e17ed8c960
parente6360f0dc52b93a723c748e281fb99b430297da4
netpoll: hold rcu read lock in __netpoll_send_skb()

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>
net/core/netpoll.c