Re: [PATCH net-next v2 1/2] netconsole: avoid printing partially updated target attributes

From: Breno Leitao

Date: Thu Oct 15 2026 - 06:09:16 EST


On Mon, Oct 12, 2026 at 06:03:43PM +0100, Gustavo Luiz Duarte wrote:
> The configfs store callbacks all serialize on dynamic_netconsole_mutex
> but not on the read side, so reading an attribute while it is being
> written returns a partially updated value.
>
> Hold dynamic_netconsole_mutex on *_show() callbacks to avoid racing with
> writers.
>
> The dev_name_show() callback can also race with
> netconsole_netdev_event() writing to np.dev_name due to
> NETDEV_CHANGENAME. So it needs to hold target_list_lock in addition to
> dynamic_netconsole_mutex.
>
> Reported-by: Sashiko <netdev-bot+sashiko@xxxxxxxxxx>
> Closes: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260814-netcons_ipv6-v3-7-bc0915e8c75f@xxxxxxxxx
> Closes: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260928-netcons-fixes-v1-0-bb5ffe5e698a%40gmail.com
> Signed-off-by: Gustavo Luiz Duarte <gustavold@xxxxxxxxx>

Reviewed-by: Breno Leitao <leitao@xxxxxxxxxx>