diff mbox series

[wrynose,1/3] u-boot: Fix CVE-2025-70290

Message ID 20261202114416.2749848-2-MandarMahesh.Kamble@windriver.com
State New
Headers show
Series u-boot: Fix CVE-2025-70290 CVE-2025-70293 | expand

Commit Message

Mandar Kamble Dec. 2, 2026, 11:44 a.m. UTC
An issue was discovered in Denx U-Boot before 2026.04. An integer
overflow vulnerability in the ZFS filesystem support can be triggered by
malformed on-disk metadata. The issue may result in incorrect memory
allocation followed by out-of-bounds memory access, potentially leading
to a crash or arbitrary code execution during the boot process.

Upstream patch:
[https://git.u-boot-project.org//u-boot/u-boot/-/commit/c8f0294285f6588322363e1711bc57118e6fc9a3]

Reference:
[https://nvd.nist.gov/vuln/detail/cve-2025-70290]
[https://security-tracker.debian.org/tracker/CVE-2025-70290]

Signed-off-by: Mandar Kamble <MandarMahesh.Kamble@windriver.com>
---
 .../u-boot/files/CVE-2025-70290.patch         | 48 +++++++++++++++++++
 meta/recipes-bsp/u-boot/u-boot_2026.01.bb     |  1 +
 2 files changed, 49 insertions(+)
 create mode 100644 meta/recipes-bsp/u-boot/files/CVE-2025-70290.patch
diff mbox series

Patch

diff --git a/meta/recipes-bsp/u-boot/files/CVE-2025-70290.patch b/meta/recipes-bsp/u-boot/files/CVE-2025-70290.patch
new file mode 100644
index 0000000000..f9ae8f11ed
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/files/CVE-2025-70290.patch
@@ -0,0 +1,48 @@ 
+From c8f0294285f6588322363e1711bc57118e6fc9a3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Timo=20tp=20Prei=C3=9Fl?= <t.preissl@proton.me>
+Date: Fri, 9 Jan 2026 11:24:51 +0000
+Subject: [PATCH] fs: prevent integer overflow in zfs_nvlist_lookup
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+An integer overflow in nvlist size calculation could lead
+to under-allocation and heap buffer overflow.
+
+Signed-off-by: Timo tp Preißl <t.preissl@proton.me>
+Reviewed-by: Simon Glass <simon.glass@canonical.com>
+Reviewed-by: Tom Rini <trini@konsulko.com>
+
+CVE: CVE-2025-70290
+
+Upstream-Status: Backport [https://git.u-boot-project.org//u-boot/u-boot/-/commit/c8f0294285f6588322363e1711bc57118e6fc9a3]
+
+Signed-off-by: Mandar Kamble <MandarMahesh.Kamble@windriver.com>
+---
+ fs/zfs/zfs.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/fs/zfs/zfs.c b/fs/zfs/zfs.c
+index 410a61aa..c7502c34 100644
+--- a/fs/zfs/zfs.c
++++ b/fs/zfs/zfs.c
+@@ -1617,6 +1617,7 @@ zfs_nvlist_lookup_nvlist(char *nvlist, char *name)
+ 	char *ret;
+ 	size_t size;
+ 	int found;
++	size_t alloc;
+ 
+ 	found = nvlist_find_value(nvlist, name, DATA_TYPE_NVLIST, &nvpair,
+ 							  &size, 0);
+@@ -1627,7 +1628,10 @@ zfs_nvlist_lookup_nvlist(char *nvlist, char *name)
+ 	 * nvlist to hold the encoding method, and two zero uint32's after the
+ 	 * nvlist as the NULL terminator.
+ 	 */
+-	ret = calloc(1, size + 3 * sizeof(uint32_t));
++	if (__builtin_add_overflow(size, 3 * sizeof(uint32_t), &alloc))
++		return 0;
++
++	ret = calloc(1, alloc);
+ 	if (!ret)
+ 		return 0;
+ 	memcpy(ret, nvlist, sizeof(uint32_t));
diff --git a/meta/recipes-bsp/u-boot/u-boot_2026.01.bb b/meta/recipes-bsp/u-boot/u-boot_2026.01.bb
index 8dd15cf9cd..409e5b6790 100644
--- a/meta/recipes-bsp/u-boot/u-boot_2026.01.bb
+++ b/meta/recipes-bsp/u-boot/u-boot_2026.01.bb
@@ -5,6 +5,7 @@  DEPENDS += "bc-native dtc-native gnutls-native python3-pyelftools-native"
 
 SRC_URI += "file://CVE-2026-46728.patch \
             file://CVE-2026-29009.patch \
+            file://CVE-2025-70290.patch \
 "
 
 CVE_STATUS[CVE-2026-33243] = "cpe-incorrect: NVD currently maps this CVE to denx:u-boot, but that mapping is incorrect for U-Boot; the U-Boot-side FIT issue is tracked separately as CVE-2026-46728 and is fixed by the included U-Boot backport."