[PATCH net v5 0/4] netconsole: fix target enable race and configfs read locking
From: Gustavo Luiz Duarte
Date: Mon Nov 02 2026 - 15:37:34 EST
While looking into the sashiko report about local_ip_show() and
remote_ip_show() missing proper locking [1], I noticed a couple other
places that need locking:
Patch 1 fixes a null-ptr-deref when enabling a target races against a
NETDEV_UNREGISTER event.
Patch 2 fixes a use-after-free when the local_mac_show() callback
races against a NETDEV_UNREGISTER event.
Patch 3 fixes yet another race, in netcons_netpoll_setup(), where
netconsole could miss the NETDEV_UNREGISTER notification and keep
holding a reference to an unregistered device.
[1] https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260814-netcons_ipv6-v3-7-bc0915e8c75f@xxxxxxxxx
Signed-off-by: Gustavo Luiz Duarte <gustavold@xxxxxxxxx>
---
Changes in v5:
- Add patch 4: netconsole: stop waiting for carrier once the device is unregistered.
- Link to v4: https://patch.msgid.link/20261021-netcons-fixes-v4-0-3857120c6340@xxxxxxxxx
Changes in v4:
- Add patch 3: netconsole: fix target enable race and configfs read locking.
- Link to v3: https://patch.msgid.link/20261012-netcons-fixes-v3-0-1aac85ed7665@xxxxxxxxx
Changes in v3:
- Use target_list_lock instead of RTNL in local_mac_show.
- Link to v2: https://patch.msgid.link/20261006-netcons-fixes-v2-0-ca652d55fd4a@xxxxxxxxx
Changes in v2:
- Resending for the 'net' tree.
- Link to v1: https://patch.msgid.link/20260928-netcons-fixes-v1-0-bb5ffe5e698a@xxxxxxxxx
To: Breno Leitao <leitao@xxxxxxxxxx>
To: Andrew Lunn <andrew+netdev@xxxxxxx>
To: "David S. Miller" <davem@xxxxxxxxxxxxx>
To: Eric Dumazet <edumazet@xxxxxxxxxx>
To: Jakub Kicinski <kuba@xxxxxxxxxx>
To: Paolo Abeni <pabeni@xxxxxxxxxx>
To: Stephen Hemminger <stephen@xxxxxxxxxxxxxxxxxx>
Cc: netdev@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
---
Gustavo Luiz Duarte (4):
netconsole: finish enabling the target before releasing RTNL
netconsole: read np.dev under target_list_lock in local_mac_show()
netconsole: recheck device registration after waiting for carrier
netconsole: stop waiting for carrier once the device is unregistered
drivers/net/netconsole.c | 42 +++++++++++++++++++++++++++++++++---------
1 file changed, 33 insertions(+), 9 deletions(-)
---
base-commit: 7308ef8b4a6779a39f68d053c19b53a5c584a663
change-id: 20260925-netcons-fixes-93a3e14326b5
Best regards,
--
Gustavo Luiz Duarte <gustavold@xxxxxxxxx>