diff options
author | Breno Leitao <[email protected]> | 2024-07-12 07:34:15 -0700 |
---|---|---|
committer | Jakub Kicinski <[email protected]> | 2024-07-14 07:38:44 -0700 |
commit | 97d9fba9a812cada5484667a46e14a4c976ca330 (patch) | |
tree | 3d56b4f8e57dbdcae0ee5648335ed9c8599a1750 /lib/memory-notifier-error-inject.c | |
parent | d657f5c76c47eca50dd61b5c1e150dac05e07046 (diff) |
net: netconsole: Disable target before netpoll cleanup
Currently, netconsole cleans up the netpoll structure before disabling
the target. This approach can lead to race conditions, as message
senders (write_ext_msg() and write_msg()) check if the target is
enabled before using netpoll. The sender can validate that the target is
enabled, but, the netpoll might be de-allocated already, causing
undesired behaviours.
This patch reverses the order of operations:
1. Disable the target
2. Clean up the netpoll structure
This change eliminates the potential race condition, ensuring that
no messages are sent through a partially cleaned-up netpoll structure.
Fixes: 2382b15bcc39 ("netconsole: take care of NETDEV_UNREGISTER event")
Cc: [email protected]
Signed-off-by: Breno Leitao <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions