CVE-2026-98929: macsec: initialize SecY before registering the netdevice
In the Linux kernel, the following vulnerability has been resolved:
macsec: initialize SecY before registering the netdevice
Creating a MACsec device with MAC offload over an LRO-capable lower device triggers a warning in rtmsgifinfobuildskb() when IPv4 forwarding is enabled by default.
registernetdevice() invokes inetdevinit(), which disables LRO and emits a NETDEVFEATCHANGE notification. This reaches macsecfillinfo() before macsecadddev() initializes the SecY. keylen is still zero, so macsecfillinfo() returns -EMSGSIZE and trips the WARNON in rtmsgifinfobuildskb(), even though the skb has enough space.
Even without the warning, notifications during registration can report uninitialized SecY attributes, including the SCI. This ordering has existed since the driver was introduced.
Initialize the SecY and apply the new-link attributes before registration. Move MAC address inheritance into macsecnewlink() so the SCI can also be initialized before registration-time notifications report it. Move the per-CPU statistics and metadata destination allocation into ndoinit(), and release partial allocations on failure.