CVE-2026-98929: macsec: initialize SecY before registering the netdevice
From: Greg Kroah-Hartman <[email protected]>
Description
===========
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 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.
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 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.
The Linux kernel CVE team has assigned CVE-2026-98929 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.6 with commit c09440f7dcb304002dfced8c0fea289eb25f2da0 and fixed in 6.18.55 with commit 2b42adf3b8ee9a0e1d2629aca3c5a02a1c438066 Issue introduced in 4.6 with commit c09440f7dcb304002dfced8c0fea289eb25f2da0 and fixed in 7.2.9 with commit b07bea42bf590edb0fd507ab25622a74af09548b Issue introduced in 4.6 with commit c09440f7dcb304002dfced8c0fea289eb25f2da0 and fixed in 7.3 with commit c2de369c5c5b8599ca10fd5ca8d11fcd845c1331
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-98929
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/net/macsec.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/2b42adf3b8ee9a0e1d2629aca3c5a02a1c438066 https://git.kernel.org/stable/c/b07bea42bf590edb0fd507ab25622a74af09548b https://git.kernel.org/stable/c/c2de369c5c5b8599ca10fd5ca8d11fcd845c1331