Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDAB3273D92 for ; Tue, 23 Sep 2025 06:01:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758607307; cv=none; b=hP0GiWxRLwj119NcQGVmNj1L90vPimx8GIf2Lwk6pt/RYJ95N9ut3yK/H1ZV3MIPooYvGS2AijkLOp3CPpjpqfNXyHaa3Q8hYusYpvhR8cpyHD2fjqnz8k3MdRaCaCJ64MJb0ZFY9oTcM8XSvE7MTglqGt4C5WQl4RgRyG0kyAM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758607307; c=relaxed/simple; bh=ff7QGvUYn1PTVAJefAmOS/d10snxF6hLwJVSOGs85bk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pbHi1T5RgTdd2l3di/jjljy69mkzgx5hZZH3p2nRoRNiLTL6Sf86eJCAPgy63bLXNpPIP3jfvbHhtAAFD9GaY4UjdSyxwxLNzFWkEUtQ35Uve7svTyvd5qnbv5FeQ/ZvKHA5+aNw9NxkU1ixGzobL/6imuN20hwQXFktuwCZr6I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=avnJ0yy5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="avnJ0yy5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35E17C4CEF5; Tue, 23 Sep 2025 06:01:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758607306; bh=ff7QGvUYn1PTVAJefAmOS/d10snxF6hLwJVSOGs85bk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=avnJ0yy5U/8nOjHpa1IwdtzfHzNGEByj9vxRJehgEaCx9aeNcw1zB1CM+9sKYoJko Atk9yxua4wv+PBQrRxVX+D7dX/UczTHdqDsk97WOAlkg8zfzndlJpuW7BjMSUw+7Na u1lBlpyB2o5X6a0aTw9GgW6Jik1sjOq1iHU3uDoI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39874: macsec: sync features on RTM_NEWLINK Date: Tue, 23 Sep 2025 08:01:05 +0200 Message-ID: <2025092300-CVE-2025-39874-d462@gregkh> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3520; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=MGLLq/4gUh39Bq43/v6AHqhoAAem3LXktVy1eDSt7Y8=; b=owGbwMvMwCRo6H6F97bub03G02pJDBmXzOessjjPqFFy4+qTjw8EsyZ1bp7g+0i67LWHpNcPz tfz7i162BHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQAT4VnAsOC08/Mlli+UlqUr JM2Ysm1t1IWTNc8Y5oo/7VvQrSyysGjazLdGDbd4zk/yVwcA X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: macsec: sync features on RTM_NEWLINK Syzkaller managed to lock the lower device via ETHTOOL_SFEATURES: netdev_lock include/linux/netdevice.h:2761 [inline] netdev_lock_ops include/net/netdev_lock.h:42 [inline] netdev_sync_lower_features net/core/dev.c:10649 [inline] __netdev_update_features+0xcb1/0x1be0 net/core/dev.c:10819 netdev_update_features+0x6d/0xe0 net/core/dev.c:10876 macsec_notify+0x2f5/0x660 drivers/net/macsec.c:4533 notifier_call_chain+0x1b3/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2267 [inline] call_netdevice_notifiers net/core/dev.c:2281 [inline] netdev_features_change+0x85/0xc0 net/core/dev.c:1570 __dev_ethtool net/ethtool/ioctl.c:3469 [inline] dev_ethtool+0x1536/0x19b0 net/ethtool/ioctl.c:3502 dev_ioctl+0x392/0x1150 net/core/dev_ioctl.c:759 It happens because lower features are out of sync with the upper: __dev_ethtool (real_dev) netdev_lock_ops(real_dev) ETHTOOL_SFEATURES __netdev_features_change netdev_sync_upper_features disable LRO on the lower if (old_features != dev->features) netdev_features_change fires NETDEV_FEAT_CHANGE macsec_notify NETDEV_FEAT_CHANGE netdev_update_features (for each macsec dev) netdev_sync_lower_features if (upper_features != lower_features) netdev_lock_ops(lower) # lower == real_dev stuck ... netdev_unlock_ops(real_dev) Per commit af5f54b0ef9e ("net: Lock lower level devices when updating features"), we elide the lock/unlock when the upper and lower features are synced. Makes sure the lower (real_dev) has proper features after the macsec link has been created. This makes sure we never hit the situation where we need to sync upper flags to the lower. The Linux kernel CVE team has assigned CVE-2025-39874 to this issue. Affected and fixed versions =========================== Issue introduced in 6.15 with commit 7e4d784f5810bba76c4593791028e13cce4af547 and fixed in 6.16.8 with commit d7624629ccf47135c65fef0701fa0d9a115b87f3 Issue introduced in 6.15 with commit 7e4d784f5810bba76c4593791028e13cce4af547 and fixed in 6.17-rc6 with commit 0f82c3ba66c6b2e3cde0f255156a753b108ee9dc 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-2025-39874 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/d7624629ccf47135c65fef0701fa0d9a115b87f3 https://git.kernel.org/stable/c/0f82c3ba66c6b2e3cde0f255156a753b108ee9dc