Re: [syzbot] [net?] WARNING in rtmsg_ifinfo_build_skb

From: Eric Dumazet

Date: Tue Aug 18 2026 - 09:41:19 EST


On Sat, Aug 15, 2026 at 1:14 AM Sabrina Dubroca <sd@xxxxxxxxxxxxxxx> wrote:

> 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.

SGTM, I let you send a patch.

>
> 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.

Thanks