summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorAnkur Tyagi <ankur.tyagi85@gmail.com>2025-10-29 00:32:46 +1300
committerAnuj Mittal <anuj.mittal@intel.com>2025-10-30 14:43:34 +0800
commit81c0782d8f07966c7999be522bb41c35634944ee (patch)
tree2266518cfb3afd1bb283ef6c3033cd6f6af76c04 /meta-oe
parent73e3b3c308465de94293ca477f11dfb5d893cf49 (diff)
downloadmeta-openembedded-81c0782d8f07966c7999be522bb41c35634944ee.tar.gz
hdf5: patch CVE-2025-2925
Details https://nvd.nist.gov/vuln/detail/CVE-2025-2925 Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-support/hdf5/files/CVE-2025-2925.patch53
-rw-r--r--meta-oe/recipes-support/hdf5/hdf5_1.14.4-3.bb1
2 files changed, 54 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/hdf5/files/CVE-2025-2925.patch b/meta-oe/recipes-support/hdf5/files/CVE-2025-2925.patch
new file mode 100644
index 0000000000..23bc4e5577
--- /dev/null
+++ b/meta-oe/recipes-support/hdf5/files/CVE-2025-2925.patch
@@ -0,0 +1,53 @@
1From 57a511958842f50cbf07b05262f2fe95e70c141b Mon Sep 17 00:00:00 2001
2From: Glenn Song <43005495+glennsong09@users.noreply.github.com>
3Date: Thu, 9 Oct 2025 14:48:55 -0500
4Subject: [PATCH] Fix CVE-2025-2925 (#5739)
5
6This PR fixes issue #5383, which was occurring due to actual_len + H5C_IMAGE_EXTRA_SPACE being 0. When realloc was called, it freed image, but gets sent to done before new_image can be assigned to image. Because the pointer for image isn't null, it attempts to free it here again, causing the double free to occur. This PR addresses Quincey's concern and fixes the issue while preserving new_image and image.
7
8The bug was first reproduced using the fuzzer and the POC file from #5383. With this change, the double free no longer occurs.
9
10CVE: CVE-2025-2925
11Upstream-Status: Backport [https://github.com/HDFGroup/hdf5/commit/4310c19608455c17a213383d07715efb2918defc]
12
13(cherry picked from commit 4310c19608455c17a213383d07715efb2918defc)
14Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
15---
16 src/H5Centry.c | 10 ++++++++++
17 1 file changed, 10 insertions(+)
18
19diff --git a/src/H5Centry.c b/src/H5Centry.c
20index 6883e89..bef93d8 100644
21--- a/src/H5Centry.c
22+++ b/src/H5Centry.c
23@@ -1051,9 +1051,14 @@ H5C__load_entry(H5F_t *f,
24 */
25 do {
26 if (actual_len != len) {
27+ /* Verify that the length isn't a bad value */
28+ if (len == 0)
29+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "len is a bad value");
30+
31 if (NULL == (new_image = H5MM_realloc(image, len + H5C_IMAGE_EXTRA_SPACE)))
32 HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, "image null after H5MM_realloc()");
33 image = (uint8_t *)new_image;
34+
35 #if H5C_DO_MEMORY_SANITY_CHECKS
36 H5MM_memcpy(image + len, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE);
37 #endif /* H5C_DO_MEMORY_SANITY_CHECKS */
38@@ -1104,10 +1109,15 @@ H5C__load_entry(H5F_t *f,
39 if (H5C__verify_len_eoa(f, type, addr, &actual_len, true) < 0)
40 HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "actual_len exceeds EOA");
41
42+ /* Verify that the length isn't 0 */
43+ if (actual_len == 0)
44+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "actual_len is a bad value");
45+
46 /* Expand buffer to new size */
47 if (NULL == (new_image = H5MM_realloc(image, actual_len + H5C_IMAGE_EXTRA_SPACE)))
48 HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, "image null after H5MM_realloc()");
49 image = (uint8_t *)new_image;
50+
51 #if H5C_DO_MEMORY_SANITY_CHECKS
52 H5MM_memcpy(image + actual_len, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE);
53 #endif /* H5C_DO_MEMORY_SANITY_CHECKS */
diff --git a/meta-oe/recipes-support/hdf5/hdf5_1.14.4-3.bb b/meta-oe/recipes-support/hdf5/hdf5_1.14.4-3.bb
index 6bc56f22cc..2832c7e851 100644
--- a/meta-oe/recipes-support/hdf5/hdf5_1.14.4-3.bb
+++ b/meta-oe/recipes-support/hdf5/hdf5_1.14.4-3.bb
@@ -20,6 +20,7 @@ SRC_URI = " \
20 file://CVE-2025-2915.patch \ 20 file://CVE-2025-2915.patch \
21 file://CVE-2025-2923-CVE-2025-6816-CVE-2025-6856.patch \ 21 file://CVE-2025-2923-CVE-2025-6816-CVE-2025-6856.patch \
22 file://CVE-2025-2924.patch \ 22 file://CVE-2025-2924.patch \
23 file://CVE-2025-2925.patch \
23" 24"
24SRC_URI[sha256sum] = "019ac451d9e1cf89c0482ba2a06f07a46166caf23f60fea5ef3c37724a318e03" 25SRC_URI[sha256sum] = "019ac451d9e1cf89c0482ba2a06f07a46166caf23f60fea5ef3c37724a318e03"
25 26