From: Hangbin Liu <hangbin.liu@linux.dev>
To: Sabrina Dubroca <sd@queasysnail.net>
Cc: Eric Dumazet <edumazet@google.com>,
syzbot <syzbot+f2f6312ad1b5a0bfe316@syzkaller.appspotmail.com>,
davem@davemloft.net, horms@kernel.org, kuba@kernel.org,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
pabeni@redhat.com, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [net?] WARNING in rtmsg_ifinfo_build_skb
Date: Wed, 19 Aug 2026 16:06:15 +0800 [thread overview]
Message-ID: <aoVj9yxiWrZXJ9X8@fedora> (raw)
In-Reply-To: <an-hOd_nV-xUqpUq@krikkit>
Hi Sabrina,
Wish you all well.
On Sat, Aug 15, 2026 at 01:14:01AM +0200, Sabrina Dubroca wrote:
> > diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
> > index ee0e2eb7dbc61c1affe4b0203337f2fdaeaa031c..0844f551d3be696bad72a8322fa4ea1bf9ccf105
> > 100644
> > --- a/drivers/net/macsec.c
> > +++ b/drivers/net/macsec.c
> > @@ -4402,7 +4402,7 @@ static int macsec_fill_info(struct sk_buff *skb,
> > csid = secy->xpn ? MACSEC_CIPHER_ID_GCM_AES_XPN_256 :
> > MACSEC_CIPHER_ID_GCM_AES_256;
> > break;
> > default:
> > - goto nla_put_failure;
> > + return 0;
> > }
>
> It's not possible to create a macsec device with a key length other
> than those 2, but it's true that returning -EMSGSIZE in this case is
> not correct (-EINVAL + DEBUG_NET_WARN_ON_ONCE I guess).
>
> The real problem is that we register the netdev before private data
> has been fully initialized (macsec_newlink calls register_netdevice,
> then macsec_add_dev), so we end up reaching fill_info before key_len
> has been set.
>
> So I think we should run macsec_add_dev before registering (and maybe
> move those allocs to ndo_init), and possibly macsec_changelink_common
> too. Setting the sci was intentionally done late, so this bit should
> stay where it is.
IIRC, we talked about this issue some time ago, but I forgot to fix it.
Sorry, I also have to leave it to you to fix it. But feel free to tell me
if you are too busy.
Best Regards
Hangbin
prev parent reply other threads:[~2026-08-19 8:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 15:33 [syzbot] [net?] WARNING in rtmsg_ifinfo_build_skb syzbot
2026-08-14 15:35 ` Eric Dumazet
2026-08-14 15:37 ` syzbot
2026-08-14 23:14 ` Sabrina Dubroca
2026-08-18 13:37 ` Eric Dumazet
2026-08-19 8:06 ` Hangbin Liu [this message]
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=aoVj9yxiWrZXJ9X8@fedora \
--to=hangbin.liu@linux.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.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=sd@queasysnail.net \
--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