From: Sabrina Dubroca <sd@queasysnail.net>
To: Haseeb Malik via B4 Relay <devnull+haseebulhaq55.gmail.com@kernel.org>
Cc: felix.walter@cloudandheat.com, edumazet@google.com,
linux-kernel@vger.kernel.org, andrew+netdev@lunn.ch,
hangbin.liu@linux.dev, kuba@kernel.org, netdev@vger.kernel.org,
pabeni@redhat.com, horms@kernel.org, davem@davemloft.net,
syzkaller-bugs@googlegroups.com,
syzbot+f2f6312ad1b5a0bfe316@syzkaller.appspotmail.com,
Haseeb Malik <haseebulhaq55@gmail.com>
Subject: Re: [PATCH net v2] macsec: initialize SecY before registering the netdevice
Date: Mon, 21 Sep 2026 11:29:23 +0200 [thread overview]
Message-ID: <arD488xDvFFwtTTN@krikkit> (raw)
In-Reply-To: <20260918-fix-macsec-net-v2-1-784203ec4836@gmail.com>
2026-09-18, 15:01:29 -0400, Haseeb Malik via B4 Relay wrote:
> From: Haseeb Malik <haseebulhaq55@gmail.com>
>
> Creating a MACsec device with MAC offload over an LRO-capable lower
> device triggers a warning in rtmsg_ifinfo_build_skb() when IPv4
> forwarding is enabled by default.
>
> register_netdevice() invokes inetdev_init(), which disables LRO and emits
> a NETDEV_FEAT_CHANGE notification. This reaches macsec_fill_info() before
> macsec_add_dev() initializes the SecY. key_len is still zero, so
> macsec_fill_info() returns -EMSGSIZE and trips the WARN_ON in
> rtmsg_ifinfo_build_skb(), even though the skb has enough space.
>
> Initialize the SecY and apply the new-link attributes before registration.
> Move MAC address inheritance into macsec_newlink() so the SCI can also be
> initialized before registration-time notifications report it. Move the
> per-CPU statistics and metadata destination allocation into ndo_init(),
> and release partial allocations on failure.
>
> Fixes: ccfdec908922 ("macsec: Add support for GCM-AES-256 cipher suite")
Why this commit? The "register, then init SCI etc" order of operations
has existed since day 1. Without ccfdec908922 we don't hit the WARN_ON
in rtmsg_ifinfo_build_skb, but the bit fixed by "Registration can
notify listeners before returning." would still be bogus.
The patch itself looks ok. Thanks for picking this up, things got
crazy and I forgot about it.
--
Sabrina
next prev parent reply other threads:[~2026-09-21 9:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 19:01 Haseeb Malik via B4 Relay
2026-09-21 9:29 ` Sabrina Dubroca [this message]
2026-09-21 20:43 ` Haseeb Malik
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=arD488xDvFFwtTTN@krikkit \
--to=sd@queasysnail.net \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=devnull+haseebulhaq55.gmail.com@kernel.org \
--cc=edumazet@google.com \
--cc=felix.walter@cloudandheat.com \
--cc=hangbin.liu@linux.dev \
--cc=haseebulhaq55@gmail.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=syzbot+f2f6312ad1b5a0bfe316@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®