summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-support/hdf5/files/CVE-2025-2153.patch51
-rw-r--r--meta-oe/recipes-support/hdf5/hdf5_1.14.4-3.bb1
2 files changed, 52 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/hdf5/files/CVE-2025-2153.patch b/meta-oe/recipes-support/hdf5/files/CVE-2025-2153.patch
new file mode 100644
index 0000000000..6f77ad330b
--- /dev/null
+++ b/meta-oe/recipes-support/hdf5/files/CVE-2025-2153.patch
@@ -0,0 +1,51 @@
1From 586f01d74f23dabcd733c82a05cf26bf123a91dc Mon Sep 17 00:00:00 2001
2From: Libo Chen <libo.chen.cn@windriver.com>
3Date: Fri, 30 Jan 2026 11:42:10 +0800
4Subject: [PATCH] Fix CVE-2025-2153
5
6This PR fixes #5329. Previously, the message flags field was able to be modified such that a message that is not sharable according to the share_flags field in H5O_msg_class_t could be treated as sharable. A check has been added to make sure messages that are not sharable can't be modified so that they indicate they can be shared.
7
8The bug was first reproduced using the fuzzer and the POC file from #5329. With this change, the heap based buffer overflow no longer occurs.
9
10CVE: CVE-2025-2153
11
12Upstream-Status: Backport [https://github.com/HDFGroup/hdf5/commit/38954615fc079538aa45d48097625a6d76aceef0]
13
14Signed-off-by: Libo Chen <libo.chen.cn@windriver.com>
15---
16 src/H5Ocache.c | 4 ++--
17 src/H5Omessage.c | 3 +++
18 2 files changed, 5 insertions(+), 2 deletions(-)
19
20diff --git a/src/H5Ocache.c b/src/H5Ocache.c
21index 9b82509..7203490 100644
22--- a/src/H5Ocache.c
23+++ b/src/H5Ocache.c
24@@ -1422,8 +1422,8 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t chunk_size, const uint8_t
25 else {
26 /* Check for message of unshareable class marked as "shareable"
27 */
28- if ((flags & H5O_MSG_FLAG_SHAREABLE) && H5O_msg_class_g[id] &&
29- !(H5O_msg_class_g[id]->share_flags & H5O_SHARE_IS_SHARABLE))
30+ if (((flags & H5O_MSG_FLAG_SHARED) || (flags & H5O_MSG_FLAG_SHAREABLE)) &&
31+ H5O_msg_class_g[id] && !(H5O_msg_class_g[id]->share_flags & H5O_SHARE_IS_SHARABLE))
32 HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL,
33 "message of unshareable class flagged as shareable");
34
35diff --git a/src/H5Omessage.c b/src/H5Omessage.c
36index 7190e46..fb9006c 100644
37--- a/src/H5Omessage.c
38+++ b/src/H5Omessage.c
39@@ -354,6 +354,9 @@ H5O__msg_write_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, unsigned m
40 */
41 assert(!(mesg_flags & H5O_MSG_FLAG_DONTSHARE));
42
43+ /* Sanity check to see if the type is not sharable */
44+ assert(type->share_flags & H5O_SHARE_IS_SHARABLE);
45+
46 /* Remove the old message from the SOHM index */
47 /* (It would be more efficient to try to share the message first, then
48 * delete it (avoiding thrashing the index in the case the ref.
49--
502.34.1
51
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 e8432f0d6b..09793b3d74 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
@@ -24,6 +24,7 @@ SRC_URI = " \
24 file://CVE-2025-6269-CVE-2025-6270-CVE-2025-6516_01.patch \ 24 file://CVE-2025-6269-CVE-2025-6270-CVE-2025-6516_01.patch \
25 file://CVE-2025-6269-CVE-2025-6270-CVE-2025-6516_02.patch \ 25 file://CVE-2025-6269-CVE-2025-6270-CVE-2025-6516_02.patch \
26 file://CVE-2025-2926.patch \ 26 file://CVE-2025-2926.patch \
27 file://CVE-2025-2153.patch \
27" 28"
28SRC_URI[sha256sum] = "019ac451d9e1cf89c0482ba2a06f07a46166caf23f60fea5ef3c37724a318e03" 29SRC_URI[sha256sum] = "019ac451d9e1cf89c0482ba2a06f07a46166caf23f60fea5ef3c37724a318e03"
29 30