diff options
author | Breno Leitao <leitao@debian.org> | 2024-08-08 05:25:11 -0700 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2024-08-13 10:58:58 +0200 |
commit | 97714695ef904a4bdba75ca2f339215c0ae2b1fa (patch) | |
tree | 80b2b6a30cb2a326778c8cb0f1860a88646c6fee /drivers/net/ethernet/intel/ice/ice_common.h | |
parent | f2ab4c1a9288774b1f9c102f0cb1b478965169bb (diff) |
net: netconsole: Defer netpoll cleanup to avoid lock release during list traversal
Current issue:
- The `target_list_lock` spinlock is held while iterating over
target_list() entries.
- Mid-loop, the lock is released to call __netpoll_cleanup(), then
reacquired.
- This practice compromises the protection provided by
`target_list_lock`.
Reason for current design:
1. __netpoll_cleanup() may sleep, incompatible with holding a spinlock.
2. target_list_lock must be a spinlock because write_msg() cannot sleep.
(See commit b5427c27173e ("[NET] netconsole: Support multiple logging
targets"))
Defer the cleanup of the netpoll structure to outside the
target_list_lock() protected area. Create another list
(target_cleanup_list) to hold the entries that need to be cleaned up,
and clean them using a mutex (target_cleanup_list_lock).
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_common.h')
0 files changed, 0 insertions, 0 deletions