diff options
| author | Libo Chen <libo.chen.cn@windriver.com> | 2026-04-10 15:05:03 +0800 |
|---|---|---|
| committer | Anuj Mittal <anuj.mittal@oss.qualcomm.com> | 2026-04-15 14:12:18 +0530 |
| commit | 69fcb4d4b1bbd991f12185ef11dfe81561375887 (patch) | |
| tree | 9d54299924a7743e9f6275a6f6e5b9366c490135 | |
| parent | c96f578f10812ea0be4bace170d62f1a116dc0fc (diff) | |
| download | meta-openembedded-69fcb4d4b1bbd991f12185ef11dfe81561375887.tar.gz | |
hdf5: fix CVE-2025-44905
According to [1], hdf5 v1.14.6 was discovered to contain a heap buffer
overflow via the H5Z__filter_scaleoffset function.
Backport patch [2] from upstream to fix CVE-2025-44905
[1] https://nvd.nist.gov/vuln/detail/CVE-2025-44905
[2] https://github.com/HDFGroup/hdf5/commit/42588aeba786a121fec1fbad72cf39d8f60a4983
Signed-off-by: Libo Chen <libo.chen.cn@windriver.com>
Signed-off-by: Jinfeng Wang <jinfeng.wang.cn@windriver.com>
Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
| -rw-r--r-- | meta-oe/recipes-support/hdf5/files/CVE-2025-44905.patch | 46 | ||||
| -rw-r--r-- | meta-oe/recipes-support/hdf5/hdf5_1.14.4-3.bb | 1 |
2 files changed, 47 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/hdf5/files/CVE-2025-44905.patch b/meta-oe/recipes-support/hdf5/files/CVE-2025-44905.patch new file mode 100644 index 0000000000..91ad655760 --- /dev/null +++ b/meta-oe/recipes-support/hdf5/files/CVE-2025-44905.patch | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | From d7ed737287ef2ecc6efd006fa11c3f784cdbdba6 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Libo Chen <libo.chen.cn@windriver.com> | ||
| 3 | Date: Fri, 30 Jan 2026 14:37:09 +0800 | ||
| 4 | Subject: [PATCH] H5Zscaleoffset: add buffer size check to prevent | ||
| 5 | out-of-bounds reads | ||
| 6 | |||
| 7 | Adds a buffer size check in H5Z__filter_scaleoffset to prevent out-of-bounds reads with malformed HDF5 files. | ||
| 8 | |||
| 9 | Fixes CVE-2025-44905. | ||
| 10 | |||
| 11 | CVE: CVE-2025-44905 | ||
| 12 | |||
| 13 | Upstream-Status: Backport [https://github.com/HDFGroup/hdf5/commit/42588aeba786a121fec1fbad72cf39d8f60a4983] | ||
| 14 | |||
| 15 | Signed-off-by: Libo Chen <libo.chen.cn@windriver.com> | ||
| 16 | --- | ||
| 17 | src/H5Zscaleoffset.c | 6 ++++++ | ||
| 18 | 1 file changed, 6 insertions(+) | ||
| 19 | |||
| 20 | diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c | ||
| 21 | index 048344b..fbf12d6 100644 | ||
| 22 | --- a/src/H5Zscaleoffset.c | ||
| 23 | +++ b/src/H5Zscaleoffset.c | ||
| 24 | @@ -1205,6 +1205,9 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu | ||
| 25 | unsigned minval_size = 0; | ||
| 26 | |||
| 27 | minbits = 0; | ||
| 28 | + if (H5_IS_BUFFER_OVERFLOW((unsigned char *)*buf, 5, (unsigned char *)*buf + *buf_size - 1)) | ||
| 29 | + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "buffer too short"); | ||
| 30 | + | ||
| 31 | for (i = 0; i < 4; i++) { | ||
| 32 | minbits_mask = ((unsigned char *)*buf)[i]; | ||
| 33 | minbits_mask <<= i * 8; | ||
| 34 | @@ -1220,6 +1223,9 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu | ||
| 35 | minval_size = sizeof(unsigned long long) <= ((unsigned char *)*buf)[4] ? sizeof(unsigned long long) | ||
| 36 | : ((unsigned char *)*buf)[4]; | ||
| 37 | minval = 0; | ||
| 38 | + if (H5_IS_BUFFER_OVERFLOW((unsigned char *)*buf, 5 + minval_size, | ||
| 39 | + (unsigned char *)*buf + *buf_size - 1)) | ||
| 40 | + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "buffer too short"); | ||
| 41 | for (i = 0; i < minval_size; i++) { | ||
| 42 | minval_mask = ((unsigned char *)*buf)[5 + i]; | ||
| 43 | minval_mask <<= i * 8; | ||
| 44 | -- | ||
| 45 | 2.34.1 | ||
| 46 | |||
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 b1cab21e0f..5a834bd4e3 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 | |||
| @@ -26,6 +26,7 @@ SRC_URI = " \ | |||
| 26 | file://CVE-2025-2926.patch \ | 26 | file://CVE-2025-2926.patch \ |
| 27 | file://CVE-2025-2153.patch \ | 27 | file://CVE-2025-2153.patch \ |
| 28 | file://CVE-2025-2310.patch \ | 28 | file://CVE-2025-2310.patch \ |
| 29 | file://CVE-2025-44905.patch \ | ||
| 29 | " | 30 | " |
| 30 | SRC_URI[sha256sum] = "019ac451d9e1cf89c0482ba2a06f07a46166caf23f60fea5ef3c37724a318e03" | 31 | SRC_URI[sha256sum] = "019ac451d9e1cf89c0482ba2a06f07a46166caf23f60fea5ef3c37724a318e03" |
| 31 | 32 | ||
