[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iLxq_PGZLRkkOMSMZkZRnM5NveFvOiJfQqywpqZS6fDwA@mail.gmail.com>
Date: Fri, 12 Jul 2024 09:36:17 -0700
From: Eric Dumazet <edumazet@...gle.com>
To: Breno Leitao <leitao@...ian.org>
Cc: davem@...emloft.net, pabeni@...hat.com, Jakub Kicinski <kuba@...nel.org>,
Bruno Prémont <bonbons@...ux-vserver.org>,
Matt Mackall <mpm@...enic.com>, thepacketgeek@...il.com, riel@...riel.com,
horms@...nel.org, netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH net v2] net: netconsole: Disable target before netpoll cleanup
On Fri, Jul 12, 2024 at 7:34 AM Breno Leitao <leitao@...ian.org> wrote:
>
> 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: stable@...r.kernel.org
> Signed-off-by: Breno Leitao <leitao@...ian.org>
Goof catch, thanks.
Reviewed-by: Eric Dumazet <edumazet@...gle.com>
Powered by blists - more mailing lists