diff options
| -rw-r--r-- | meta-oe/recipes-support/hdf5/files/0002-CVE-2025-2924.patch | 39 | ||||
| -rw-r--r-- | meta-oe/recipes-support/hdf5/hdf5_1.14.4-3.bb | 1 |
2 files changed, 40 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/hdf5/files/0002-CVE-2025-2924.patch b/meta-oe/recipes-support/hdf5/files/0002-CVE-2025-2924.patch new file mode 100644 index 0000000000..73ee50db1f --- /dev/null +++ b/meta-oe/recipes-support/hdf5/files/0002-CVE-2025-2924.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | From 3a6f6c1f57c09281d4a9d11a1ae809fd21b666dd Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Glenn Song <43005495+glennsong09@users.noreply.github.com> | ||
| 3 | Date: Mon, 15 Sep 2025 07:56:54 -0500 | ||
| 4 | Subject: [PATCH] CVE-2025-2924 | ||
| 5 | |||
| 6 | Fixes heap-based buffer overflow in H5HL__fl_deserialize by adding an overflow check. | ||
| 7 | |||
| 8 | CVE: CVE-2025-2924 | ||
| 9 | Upstream-Status: Backport [https://github.com/HDFGroup/hdf5/commit/0a57195ca67d278f1cf7d01566c121048e337a59] | ||
| 10 | |||
| 11 | (cherry picked from commit 0a57195ca67d278f1cf7d01566c121048e337a59) | ||
| 12 | Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com> | ||
| 13 | --- | ||
| 14 | src/H5HLcache.c | 5 +++++ | ||
| 15 | 1 file changed, 5 insertions(+) | ||
| 16 | |||
| 17 | diff --git a/src/H5HLcache.c b/src/H5HLcache.c | ||
| 18 | index d0836fe..7f412d2 100644 | ||
| 19 | --- a/src/H5HLcache.c | ||
| 20 | +++ b/src/H5HLcache.c | ||
| 21 | @@ -225,6 +225,7 @@ H5HL__fl_deserialize(H5HL_t *heap) | ||
| 22 | /* check arguments */ | ||
| 23 | assert(heap); | ||
| 24 | assert(!heap->freelist); | ||
| 25 | + HDcompile_assert(sizeof(hsize_t) == sizeof(uint64_t)); | ||
| 26 | |||
| 27 | /* Build free list */ | ||
| 28 | free_block = heap->free_block; | ||
| 29 | @@ -232,6 +233,10 @@ H5HL__fl_deserialize(H5HL_t *heap) | ||
| 30 | const uint8_t *image; /* Pointer into image buffer */ | ||
| 31 | |||
| 32 | /* Sanity check */ | ||
| 33 | + | ||
| 34 | + if (free_block > UINT64_MAX - (2 * heap->sizeof_size)) | ||
| 35 | + HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "decoded heap block address overflow"); | ||
| 36 | + | ||
| 37 | if ((free_block + (2 * heap->sizeof_size)) > heap->dblk_size) | ||
| 38 | HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "bad heap free list"); | ||
| 39 | |||
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 4305826b22..06a375c673 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 | |||
| @@ -16,6 +16,7 @@ SRC_URI = " \ | |||
| 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 | file://0001-CVE-2025-2923.patch \ |
| 19 | file://0002-CVE-2025-2924.patch \ | ||
| 19 | " | 20 | " |
| 20 | SRC_URI[sha256sum] = "019ac451d9e1cf89c0482ba2a06f07a46166caf23f60fea5ef3c37724a318e03" | 21 | SRC_URI[sha256sum] = "019ac451d9e1cf89c0482ba2a06f07a46166caf23f60fea5ef3c37724a318e03" |
| 21 | 22 | ||
