From: Gustavo Luiz Duarte <gustavold@gmail.com>
To: Breno Leitao <leitao@debian.org>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Stephen Hemminger <stephen@networkplumber.org>
Cc: Gustavo Luiz Duarte <gustavold@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH net v5 0/4] netconsole: fix target enable race and configfs read locking
Date: Mon, 02 Nov 2026 19:54:48 +0000 [thread overview]
Message-ID: <20261102-netcons-fixes-v5-0-bdada2f03563@gmail.com> (raw)
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@gmail.com
Signed-off-by: Gustavo Luiz Duarte <gustavold@gmail.com>
---
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@gmail.com
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@gmail.com
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@gmail.com
Changes in v2:
- Resending for the 'net' tree.
- Link to v1: https://patch.msgid.link/20260928-netcons-fixes-v1-0-bb5ffe5e698a@gmail.com
To: Breno Leitao <leitao@debian.org>
To: Andrew Lunn <andrew+netdev@lunn.ch>
To: "David S. Miller" <davem@davemloft.net>
To: Eric Dumazet <edumazet@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
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@gmail.com>
next reply other threads:[~2026-11-02 19:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 19:54 Gustavo Luiz Duarte [this message]
2026-11-02 19:54 ` [PATCH net v5 1/4] netconsole: finish enabling the target before releasing RTNL Gustavo Luiz Duarte
2026-11-03 12:08 ` Breno Leitao
2026-11-02 19:54 ` [PATCH net v5 2/4] netconsole: read np.dev under target_list_lock in local_mac_show() Gustavo Luiz Duarte
2026-11-03 12:08 ` Breno Leitao
2026-11-02 19:54 ` [PATCH net v5 3/4] netconsole: recheck device registration after waiting for carrier Gustavo Luiz Duarte
2026-11-03 12:09 ` Breno Leitao
2026-11-02 19:54 ` [PATCH net v5 4/4] netconsole: stop waiting for carrier once the device is unregistered Gustavo Luiz Duarte
2026-11-03 12:28 ` Breno Leitao
2026-11-06 22:10 ` [PATCH net v5 0/4] netconsole: fix target enable race and configfs read locking patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261102-netcons-fixes-v5-0-bdada2f03563@gmail.com \
--to=gustavold@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.