diff options
| author | Ankur Tyagi <ankur.tyagi85@gmail.com> | 2025-10-29 00:32:43 +1300 |
|---|---|---|
| committer | Anuj Mittal <anuj.mittal@intel.com> | 2025-10-30 14:43:33 +0800 |
| commit | bd847d489a4ca3538b2315b061f0f591df0e8ec9 (patch) | |
| tree | dc93e353cb6440f957131fc7a58444cb4710ebdb /meta-oe | |
| parent | 7d1b63f0af74a354f08de2b683e98ccd7f357b05 (diff) | |
| download | meta-openembedded-bd847d489a4ca3538b2315b061f0f591df0e8ec9.tar.gz | |
hdf5: patch CVE-2025-2915
Details https://nvd.nist.gov/vuln/detail/CVE-2025-2915
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-2915.patch | 50 | ||||
| -rw-r--r-- | meta-oe/recipes-support/hdf5/hdf5_1.14.4-3.bb | 1 |
2 files changed, 51 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/hdf5/files/CVE-2025-2915.patch b/meta-oe/recipes-support/hdf5/files/CVE-2025-2915.patch new file mode 100644 index 0000000000..83eb8ff504 --- /dev/null +++ b/meta-oe/recipes-support/hdf5/files/CVE-2025-2915.patch | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | From 2bab8a1ffae567d35effa777dda82d423a80bccd Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Glenn Song <43005495+glennsong09@users.noreply.github.com> | ||
| 3 | Date: Mon, 20 Oct 2025 07:47:28 -0500 | ||
| 4 | Subject: [PATCH] Fix CVE-2025-2915 (#5746) | ||
| 5 | |||
| 6 | This PR fixes issue #5380, which has a heap based buffer overflow after H5MF_xfree is called on an address of 0 (file superblock). This PR changes an assert making sure addr isn't 0 to an if check. | ||
| 7 | |||
| 8 | The bug was first reproduced using the fuzzer and the POC file from #5380. With this change, the heap based buffer overflow no longer occurs. | ||
| 9 | |||
| 10 | CVE: CVE-2025-2915 | ||
| 11 | Upstream-Status: Backport [https://github.com/HDFGroup/hdf5/commit/26a76bafdef3a0950d348a08667de161a19b7c2c] | ||
| 12 | (cherry picked from commit 26a76bafdef3a0950d348a08667de161a19b7c2c) | ||
| 13 | Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com> | ||
| 14 | --- | ||
| 15 | src/H5Faccum.c | 3 +++ | ||
| 16 | src/H5Ocache_image.c | 7 +++++++ | ||
| 17 | 2 files changed, 10 insertions(+) | ||
| 18 | |||
| 19 | diff --git a/src/H5Faccum.c b/src/H5Faccum.c | ||
| 20 | index 9c4c8cdbbd..145abd1cbd 100644 | ||
| 21 | --- a/src/H5Faccum.c | ||
| 22 | +++ b/src/H5Faccum.c | ||
| 23 | @@ -879,6 +879,9 @@ H5F__accum_free(H5F_shared_t *f_sh, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr | ||
| 24 | |||
| 25 | /* Calculate the size of the overlap with the accumulator, etc. */ | ||
| 26 | H5_CHECKED_ASSIGN(overlap_size, size_t, (addr + size) - accum->loc, haddr_t); | ||
| 27 | + /* Sanity check */ | ||
| 28 | + /* Overlap size should not result in "negative" value after subtraction */ | ||
| 29 | + assert(overlap_size < accum->size); | ||
| 30 | new_accum_size = accum->size - overlap_size; | ||
| 31 | |||
| 32 | /* Move the accumulator buffer information to eliminate the freed block */ | ||
| 33 | diff --git a/src/H5Ocache_image.c b/src/H5Ocache_image.c | ||
| 34 | index d91b46341c..c0ab004ec7 100644 | ||
| 35 | --- a/src/H5Ocache_image.c | ||
| 36 | +++ b/src/H5Ocache_image.c | ||
| 37 | @@ -116,6 +116,13 @@ H5O__mdci_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSE | ||
| 38 | HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); | ||
| 39 | H5F_DECODE_LENGTH(f, p, mesg->size); | ||
| 40 | |||
| 41 | + if (mesg->addr >= (HADDR_UNDEF - mesg->size)) | ||
| 42 | + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "address plus size overflows"); | ||
| 43 | + if (mesg->addr == HADDR_UNDEF) | ||
| 44 | + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "address is undefined"); | ||
| 45 | + if ((mesg->addr + mesg->size) > H5F_get_eoa(f, H5FD_MEM_SUPER)) | ||
| 46 | + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "address plus size exceeds file eoa"); | ||
| 47 | + | ||
| 48 | /* Set return value */ | ||
| 49 | ret_value = (void *)mesg; | ||
| 50 | |||
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 875510b0e2..59506526fb 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 | |||
| @@ -17,6 +17,7 @@ SRC_URI = " \ | |||
| 17 | file://0001-cmake-remove-build-flags.patch \ | 17 | file://0001-cmake-remove-build-flags.patch \ |
| 18 | file://CVE-2025-2913.patch \ | 18 | file://CVE-2025-2913.patch \ |
| 19 | file://CVE-2025-2914.patch \ | 19 | file://CVE-2025-2914.patch \ |
| 20 | file://CVE-2025-2915.patch \ | ||
| 20 | " | 21 | " |
| 21 | SRC_URI[sha256sum] = "019ac451d9e1cf89c0482ba2a06f07a46166caf23f60fea5ef3c37724a318e03" | 22 | SRC_URI[sha256sum] = "019ac451d9e1cf89c0482ba2a06f07a46166caf23f60fea5ef3c37724a318e03" |
| 22 | 23 | ||
