mbox series

[net-next,0/3] netconsole: Fix potential race condition and improve code clarity

Message ID 20240709144403.544099-1-leitao@debian.org (mailing list archive)
Headers show
Series netconsole: Fix potential race condition and improve code clarity | expand

Message

Breno Leitao July 9, 2024, 2:43 p.m. UTC
This patchset addresses a potential bug in netconsole where the netconsole
target is cleaned up before it is disabled. This sequence could lead to a
situation where an enabled target has an uninitialized netpoll structure,
potentially causing undefined behavior.

The main goals of this patchset are:

1. Correct the order of operations:
   - First, disable the netconsole target
   - Then, clean up the netpoll structure

2. Improve code readability:
   - Remove unnecessary casts
   - Eliminate redundant operations

These changes aim to enhance the reliability of netconsole by
eliminating the potential race condition and improve maintainability by
making the code more straightforward to understand and modify.

Breno Leitao (3):
  net: netconsole: Remove unnecessary cast from bool
  net: netconsole: Eliminate redundant setting of enabled field
  net: netconsole: Disable target before netpoll cleanup

 drivers/net/netconsole.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org July 12, 2024, 2 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue,  9 Jul 2024 07:43:58 -0700 you wrote:
> This patchset addresses a potential bug in netconsole where the netconsole
> target is cleaned up before it is disabled. This sequence could lead to a
> situation where an enabled target has an uninitialized netpoll structure,
> potentially causing undefined behavior.
> 
> The main goals of this patchset are:
> 
> [...]

Here is the summary with links:
  - [net-next,1/3] net: netconsole: Remove unnecessary cast from bool
    https://git.kernel.org/netdev/net-next/c/a9359e8b0065
  - [net-next,2/3] net: netconsole: Eliminate redundant setting of enabled field
    https://git.kernel.org/netdev/net-next/c/0066623d4008
  - [net-next,3/3] net: netconsole: Disable target before netpoll cleanup
    (no matching commit)

You are awesome, thank you!