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 9C64D151985 for ; Thu, 1 May 2025 13:08:31 +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=1746104912; cv=none; b=nHn4moxa8evmXsKvsFqzmTeTYyA7NdEunctlAd2znnidHF5Tpz4il9DlVbV2SGRA3VXlf7q7ag4V7xg4rN7eed/phLmVfiLojZqzHaGh1ywL61QlTMk/8rGlsVBNv0LWIDpXxlwhfQJS6NAy/ifp6zVWoMm0fEsadIkMrvDv2QE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746104912; c=relaxed/simple; bh=jHONz9cLrSPljZwPbRGi+KAIC0ygtczvyCslJJ1u4s4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=AbAy7LXvR7Z/fYFv7QFCDjJywInbA9MJwPGgZSzN80twRZIxmgpWwxa42B1Zb2TuxlxMyh+QAEcj1kNFUtN6jIzHpvvcS4IuA7mOebxPgE+0i9mkj7zP8q2Sh+Vre5oAV1IBGJZ9NOZp48QXQRDH3+u4FJwGc7GWD9vmA9ipIc8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=KeGgj+Ag; 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="KeGgj+Ag" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0FB0C4CEE3; Thu, 1 May 2025 13:08:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746104911; bh=jHONz9cLrSPljZwPbRGi+KAIC0ygtczvyCslJJ1u4s4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=KeGgj+AgL7DIUohsAqsM00TaGJVJyLOl789d3FzowNbCyXPZhSs01TUOTUrTVBXJq caUoLEvdVuOPntiCPUDDe6XHA8sCmtjxEAS2F1gPY4IWCIkU1639cauZ/lWHt4pQRO AHV/ZszAnsg7ejAJFMJvNXEKu6Dx9tblDt/4I/5M= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-37787: net: dsa: mv88e6xxx: avoid unregistering devlink regions which were never registered Date: Thu, 1 May 2025 15:07:34 +0200 Message-ID: <2025050119-CVE-2025-37787-746d@gregkh> X-Mailer: git-send-email 2.49.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=3266; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=sK4uFWpf4dLWDK+cMgybDEOxU7QkIQY51HptTS/XcF4=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnCRewcKi/Ej6sEN7/4y6vXe/jpuvBJouvPip1rvLjS8 Stvofn1jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiI0CyGBZs2xjcJsTPvmnG0 aFPgxZ7Hyt+DbzDMld1zZWtFA4vrRx2zVz6MfD18Ju88AA== 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: net: dsa: mv88e6xxx: avoid unregistering devlink regions which were never registered Russell King reports that a system with mv88e6xxx dereferences a NULL pointer when unbinding this driver: https://lore.kernel.org/netdev/Z_lRkMlTJ1KQ0kVX@shell.armlinux.org.uk/ The crash seems to be in devlink_region_destroy(), which is not NULL tolerant but is given a NULL devlink global region pointer. At least on some chips, some devlink regions are conditionally registered since the blamed commit, see mv88e6xxx_setup_devlink_regions_global(): if (cond && !cond(chip)) continue; These are MV88E6XXX_REGION_STU and MV88E6XXX_REGION_PVT. If the chip does not have an STU or PVT, it should crash like this. To fix the issue, avoid unregistering those regions which are NULL, i.e. were skipped at mv88e6xxx_setup_devlink_regions_global() time. The Linux kernel CVE team has assigned CVE-2025-37787 to this issue. Affected and fixed versions =========================== Issue introduced in 5.13 with commit 836021a2d0e0e4c90b895a35bd9c0342071855fb and fixed in 6.1.135 with commit b3c70dfe51f10df60db2646c08cebd24bcdc5247 Issue introduced in 5.13 with commit 836021a2d0e0e4c90b895a35bd9c0342071855fb and fixed in 6.6.88 with commit bbb80f004f7a90c3dcaacc982c59967457254a05 Issue introduced in 5.13 with commit 836021a2d0e0e4c90b895a35bd9c0342071855fb and fixed in 6.12.25 with commit 3665695e3572239dc233216f06b41f40cc771889 Issue introduced in 5.13 with commit 836021a2d0e0e4c90b895a35bd9c0342071855fb and fixed in 6.14.4 with commit 5f5e95945bb1e08be7655da6acba648274db457d Issue introduced in 5.13 with commit 836021a2d0e0e4c90b895a35bd9c0342071855fb and fixed in 6.15-rc3 with commit c84f6ce918a9e6f4996597cbc62536bbf2247c96 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-37787 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/dsa/mv88e6xxx/devlink.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/b3c70dfe51f10df60db2646c08cebd24bcdc5247 https://git.kernel.org/stable/c/bbb80f004f7a90c3dcaacc982c59967457254a05 https://git.kernel.org/stable/c/3665695e3572239dc233216f06b41f40cc771889 https://git.kernel.org/stable/c/5f5e95945bb1e08be7655da6acba648274db457d https://git.kernel.org/stable/c/c84f6ce918a9e6f4996597cbc62536bbf2247c96