summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-support/hdf5/files/0001-CVE-2025-2923.patch67
-rw-r--r--meta-oe/recipes-support/hdf5/hdf5_1.14.4-3.bb1
2 files changed, 68 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/hdf5/files/0001-CVE-2025-2923.patch b/meta-oe/recipes-support/hdf5/files/0001-CVE-2025-2923.patch
new file mode 100644
index 0000000000..ffaade2503
--- /dev/null
+++ b/meta-oe/recipes-support/hdf5/files/0001-CVE-2025-2923.patch
@@ -0,0 +1,67 @@
1From 951ebdce0098dac1042d5e9650e655c6c1f92904 Mon Sep 17 00:00:00 2001
2From: jhendersonHDF <jhenderson@hdfgroup.org>
3Date: Fri, 26 Sep 2025 13:13:10 -0500
4Subject: [PATCH] CVE-2025-2923
5
6Fix issue with handling of corrupted object header continuation messages (#5829)
7
8An HDF5 file could be specifically constructed such that an object
9header contained a corrupted continuation message which pointed
10back to itself. This eventually resulted in an internal buffer being
11allocated with too small of a size, leading to a heap buffer overflow
12when encoding an object header message into it. This has been fixed
13by checking the expected number of deserialized object header chunks
14against the actual value as chunks are being deserialized.
15
16Fixes CVE-2025-6816, CVE-2025-6856, CVE-2025-2923
17
18CVE: CVE-2025-2923
19Upstream-Status: Backport [https://github.com/HDFGroup/hdf5/commit/29c847a43db0cdc85b01cafa5a7613ea73932675]
20
21(cherry picked from commit 29c847a43db0cdc85b01cafa5a7613ea73932675)
22Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
23---
24 src/H5Oint.c | 17 +++++++++++------
25 1 file changed, 11 insertions(+), 6 deletions(-)
26
27diff --git a/src/H5Oint.c b/src/H5Oint.c
28index 022ee43..a5e0072 100644
29--- a/src/H5Oint.c
30+++ b/src/H5Oint.c
31@@ -1013,10 +1013,9 @@ H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, bool pin_all_chunks)
32 */
33 curr_msg = 0;
34 while (curr_msg < cont_msg_info.nmsgs) {
35- H5O_chunk_proxy_t *chk_proxy; /* Proxy for chunk, to bring it into memory */
36-#ifndef NDEBUG
37- size_t chkcnt = oh->nchunks; /* Count of chunks (for sanity checking) */
38-#endif /* NDEBUG */
39+ H5O_chunk_proxy_t *chk_proxy; /* Proxy for chunk, to bring it into memory */
40+ unsigned chunkno; /* Chunk number for chunk proxy */
41+ size_t chkcnt = oh->nchunks; /* Count of chunks (for sanity checking) */
42
43 /* Bring the chunk into the cache */
44 /* (which adds to the object header) */
45@@ -1029,14 +1028,20 @@ H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, bool pin_all_chunks)
46
47 /* Sanity check */
48 assert(chk_proxy->oh == oh);
49- assert(chk_proxy->chunkno == chkcnt);
50- assert(oh->nchunks == (chkcnt + 1));
51+
52+ chunkno = chk_proxy->chunkno;
53
54 /* Release the chunk from the cache */
55 if (H5AC_unprotect(loc->file, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, chk_proxy,
56 H5AC__NO_FLAGS_SET) < 0)
57 HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header chunk");
58
59+ if (chunkno != chkcnt)
60+ HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "incorrect chunk number for object header chunk");
61+ if (oh->nchunks != (chkcnt + 1))
62+ HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL,
63+ "incorrect number of chunks after deserializing object header chunk");
64+
65 /* Advance to next continuation message */
66 curr_msg++;
67 } /* end while */
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 f34e5f183d..4305826b22 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
@@ -15,6 +15,7 @@ SRC_URI = " \
15 https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.14/hdf5-1.14.4/src/${BPN}-${PV}.tar.gz \ 15 https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.14/hdf5-1.14.4/src/${BPN}-${PV}.tar.gz \
16 file://0002-Remove-suffix-shared-from-shared-library-name.patch \ 16 file://0002-Remove-suffix-shared-from-shared-library-name.patch \
17 file://0001-cmake-remove-build-flags.patch \ 17 file://0001-cmake-remove-build-flags.patch \
18 file://0001-CVE-2025-2923.patch \
18" 19"
19SRC_URI[sha256sum] = "019ac451d9e1cf89c0482ba2a06f07a46166caf23f60fea5ef3c37724a318e03" 20SRC_URI[sha256sum] = "019ac451d9e1cf89c0482ba2a06f07a46166caf23f60fea5ef3c37724a318e03"
20 21