Skip to contentSkip to conversation

hdf5: patch CVE-2026-19026, CVE-2026-19027 and CVE-2026-19028

PATCH New [email protected] 1 participant 14 messages Nov 5

lore
Share & tools
lore
#0 lore raw

PATCH 1/14 hdf5: patch CVE-2026-19026, CVE-2026-19027 and CVE-2026-19028

From: Ankur Tyagi <[email protected]>

Details:
https://nvd.nist.gov/vuln/detail/cve-2026-19026
https://nvd.nist.gov/vuln/detail/cve-2026-19027
https://nvd.nist.gov/vuln/detail/cve-2026-19028

---
 ...-19026-CVE-2026-19027-CVE-2026-19028.patch | 579 ++++++++++++++++++
 meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb    |   1 +
 2 files changed, 580 insertions(+)
 create mode 100644 meta-oe/recipes-support/hdf5/files/CVE-2026-19026-CVE-2026-19027-CVE-2026-19028.patch
meta-oe/recipes-support/hdf5/files/CVE-2026-19026-CVE-2026-19027-CVE-2026-19028.patch new file +579 -0
new file mode 100644
index 0000000000..8187612342
@@ -0,0 +1,579 @@
+From 8623863e172662af94d30842e1f735219b682852 Mon Sep 17 00:00:00 2001
+From: Matt L <[email protected]>
+Date: Fri, 25 Sep 2026 17:15:06 -0500
+Subject: [PATCH] Fix CVE issues related to Nbit/Fletcher32 decode paths
+ (#6497)
+
+* Fix h5ls SIGSEGVs in Nbit and Fletcher32 filter decode paths
+
+This PR fixes three related issues which could cause crashes when
+crafted files were provided to h5ls. As it happens, all three are reachable from
+any reader via H5Z_pipeline() during a chunked H5Dread(), so the root issues
+affect the library itself.
+
+1. Nbit NULL/short parameter array (#6489, "Null_Pointer")
+
+   H5Z__filter_nbit() dereferenced cd_values[0] before validating the
+   parameter array. A file storing the filter with zero client-data
+   values produced cd_values=NULL / cd_nelmts=0 and a NULL dereference.
+
+   Fix is to reject a NULL cd_values or a cd_nelmts < 5 (the header at indices
+   0..4 is always read) before any access.
+
+2. Nbit compressed-input buffer over-read (#6489, "Heap_Corruption_1")
+
+   The H5Z__nbit_decompress* family walked the compressed input via
+   index *j with no bound against the input size, and nbytes was never
+   even passed in. Malformed parameters (e.g. d_nelmts=67108876 over a
+   31-byte chunk) drove *j past the end, reading out of bounds in
+   H5Z__nbit_decompress_one_byte().
+
+   Fix is thread the input size through the whole decompress call chain,
+   convert the void helpers (_one_byte, _one_nooptype, _one_atomic)
+   to return herr_t, and bounds-check *j against buffer_size before every
+   buffer[*j] read, propagating a filter error up the stack.
+
+3. Fletcher32 checksum length underflow (#6490, "Heap_Corruption_2")
+
+   The read path computed `src_nbytes = nbytes - FLETCHER_LEN` with no
+   lower-bound check. A corrupt 0-byte chunk underflowed src_nbytes to
+   SIZE_MAX-3, which was passed straight to H5_checksum_fletcher32(),
+   causing an out-of-bounds read.
+
+   Fix is to reject nbytes<FLETCHER_LEN up
+   front, since a valid Fletcher32 buffer must contain at least the
+   trailing 4-byte checksum.
+
+All three now fail gracefully with an error instead of crashing.
+
+Fixes #6489
+Fixes #6490
+
+* Add regression tests for Nbit/Fletcher32 filter decode crashes
+
+Added regression tests for the core library to guard against
+the patched issues.
+
+These files were produced with the new generator test/gen_bad_filters.c,
+which writes each dataset via the public API (using earliest library
+version bounds so the pipeline message lands in a version-1,
+un-checksummed object header) and then patches the specific bytes.
+
+* Committing clang-format changes
+
+* Address PR #6497 review: nbit size guard, comment, CHANGELOG
+
+* Bound the nbit filter's walk through its own parameters
+
+H5Z__nbit_decompress() and the array and compound helpers previously read the
+parameter list at offsets taken from the datatype description held in
+that same list, advancing a running index as they recursed, and never
+compared the index against the number of parameters they were given.  A
+list that stopped short of the datatype it described left the walk
+reading past the end of it.  H5O__pline_decode() allocates the list at
+exactly the stored count once it exceeds H5Z_COMMON_CD_VALUES, so past
+the end is past the allocation.
+
+This commit threads the parameter count through decompression and checks it before
+each step of the walk.  The check has to sit at each step rather than
+being measured once up front, because how far the walk runs is itself
+read out of the parameters.
+
+Only the read path is bounded.  The write path walks the same
+parameters, but they are built by H5Z__set_local_nbit() rather than read
+from a file.
+
+* Update CHANGELOG
+
+* Correct bad CHANGELOG merge
+
+---------
+
+Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
+Co-authored-by: H. Joe Lee <[email protected]>
+
+CVE: CVE-2026-19026 CVE-2026-19027 CVE-2026-19028
+Upstream-Status: Backport [https://github.com/HDFGroup/hdf5/commit/a3cf1ea82cc7a66e50029a688121e1b105a7ce88]
+
+Dropped changes to the test and CHANGELOG file.
+
+Signed-off-by: Ankur Tyagi <[email protected]>
+---
+ src/H5Zfletcher32.c |   8 ++
+ src/H5Znbit.c       | 211 +++++++++++++++++++++++++++++++++-----------
+ 2 files changed, 166 insertions(+), 53 deletions(-)
+
+diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c
+index c3ec5f7ccb0..b89724ad0a3 100644
+--- a/src/H5Zfletcher32.c
++++ b/src/H5Zfletcher32.c
+@@ -62,6 +62,14 @@ H5Z__filter_fletcher32(unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts,
+     assert(sizeof(uint32_t) >= 4);
+ 
+     if (flags & H5Z_FLAG_REVERSE) { /* Read */
++        /* A Fletcher32-filtered buffer must contain at least the trailing
++         * checksum.  Reject anything smaller to avoid a size_t underflow
++         * when computing the data length.
++         */
++        if (nbytes < FLETCHER_LEN)
++            HGOTO_ERROR(H5E_STORAGE, H5E_OVERFLOW, 0,
++                        "fletcher32 filter input buffer too small to contain checksum");
++
+         /* Do checksum if it's enabled for read; otherwise skip it
+          * to save performance. */
+         if (!(flags & H5Z_FLAG_SKIP_EDC)) {
+diff --git a/src/H5Znbit.c b/src/H5Znbit.c
+index fed86a1a3bd..ce8c726370a 100644
+--- a/src/H5Znbit.c
++++ b/src/H5Znbit.c
+@@ -51,26 +51,29 @@ static herr_t H5Z__set_parms_compound(const H5T_t *type, unsigned *cd_values_ind
+                                       bool *need_not_compress);
+ 
+ static void   H5Z__nbit_next_byte(size_t *j, size_t *buf_len);
+-static void   H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
++static herr_t H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
+                                             unsigned begin_i, unsigned end_i, const unsigned char *buffer,
+-                                            size_t *j, size_t *buf_len, const parms_atomic *p,
+-                                            size_t datatype_len);
++                                            size_t buffer_size, size_t *j, size_t *buf_len,
++                                            const parms_atomic *p, size_t datatype_len);
+ static void   H5Z__nbit_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k,
+                                           unsigned begin_i, unsigned end_i, unsigned char *buffer, size_t *j,
+                                           size_t *buf_len, const parms_atomic *p, size_t datatype_len);
+-static void   H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset,
+-                                                const unsigned char *buffer, size_t *j, size_t *buf_len,
+-                                                unsigned size);
+-static void   H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer,
+-                                              size_t *j, size_t *buf_len, const parms_atomic *p);
++static herr_t H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset,
++                                                const unsigned char *buffer, size_t buffer_size, size_t *j,
++                                                size_t *buf_len, unsigned size);
++static herr_t H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer,
++                                              size_t buffer_size, size_t *j, size_t *buf_len,
++                                              const parms_atomic *p);
+ static herr_t H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer,
+-                                             size_t *j, size_t *buf_len, const unsigned parms[],
++                                             size_t buffer_size, size_t *j, size_t *buf_len,
++                                             const unsigned parms[], size_t parms_nelmts,
+                                              unsigned *parms_index);
+ static herr_t H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset,
+-                                                unsigned char *buffer, size_t *j, size_t *buf_len,
+-                                                const unsigned parms[], unsigned *parms_index);
++                                                unsigned char *buffer, size_t buffer_size, size_t *j,
++                                                size_t *buf_len, const unsigned parms[], size_t parms_nelmts,
++                                                unsigned *parms_index);
+ static herr_t H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
+-                                   const unsigned parms[]);
++                                   size_t buffer_size, const unsigned parms[], size_t parms_nelmts);
+ static void   H5Z__nbit_compress_one_nooptype(const unsigned char *data, size_t data_offset,
+                                               unsigned char *buffer, size_t *j, size_t *buf_len, unsigned size);
+ static void   H5Z__nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer,
+@@ -100,8 +103,15 @@ H5Z_class2_t H5Z_NBIT[1] = {{
+ #define H5Z_NBIT_COMPOUND   3    /* Compound datatype class */
+ #define H5Z_NBIT_NOOPTYPE   4    /* Other datatype class: nbit does no compression */
+ #define H5Z_NBIT_MAX_NPARMS 4096 /* Max number of parameters for filter */
+-#define H5Z_NBIT_ORDER_LE   0    /* Little endian for datatype byte order */
+-#define H5Z_NBIT_ORDER_BE   1    /* Big endian for datatype byte order */
++
++/* Whether the parameter list holds N more values starting at IDX.  The
++ * datatype description that drives the walk through the parameters is held in
++ * those same parameters, so a list that stops short of the datatype it
++ * describes has to be caught at each step rather than measured up front.
++ */
++#define H5Z_NBIT_PARMS_AVAIL(idx, n, nelmts) (((nelmts) >= (n)) && ((size_t)(idx) <= (nelmts) - (n)))
++#define H5Z_NBIT_ORDER_LE                    0 /* Little endian for datatype byte order */
++#define H5Z_NBIT_ORDER_BE                    1 /* Big endian for datatype byte order */
+ 
+ /* Local variables */
+ 
+@@ -931,7 +941,16 @@ H5Z__filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], s
+ 
+     /* check arguments
+      * cd_values[0] stores actual number of parameters in cd_values[]
++     *
++     * The filter header always occupies cd_values[0..4] (number of
++     * parameters, no-compression flag, number of elements, datatype class
++     * and datatype size), all of which are read unconditionally below.
++     * Reject a NULL array or one shorter than that to avoid a bad
++     * dereference.
+      */
++    if (cd_values == NULL || cd_nelmts < 5)
++        HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid nbit parameters");
++
+     if (cd_nelmts != cd_values[0])
+         HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid nbit aggression level");
+ 
+@@ -944,6 +963,18 @@ H5Z__filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], s
+     /* copy a filter parameter to d_nelmts */
+     d_nelmts = cd_values[2];
+ 
++    /* cd_values[4] stores the datatype size, which is used together with
++     * d_nelmts to size the (de)compression buffer.  A zero size is invalid,
++     * and a d_nelmts * size product that overflows size_t would produce an
++     * undersized allocation and out-of-bounds accesses (this matters on
++     * platforms with a 32-bit size_t).  Reject both, as they can only arise
++     * from a corrupted or crafted file.
++     */
++    if (cd_values[4] == 0)
++        HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid nbit datatype size");
++    if (d_nelmts != 0 && (size_t)cd_values[4] > SIZE_MAX / d_nelmts)
++        HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, 0, "nbit (de)compression buffer size overflow");
++
+     /* input; decompress */
+     if (flags & H5Z_FLAG_REVERSE) {
+         size_out = d_nelmts * (size_t)cd_values[4]; /* cd_values[4] stores datatype size */
+@@ -953,7 +984,7 @@ H5Z__filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], s
+             HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for nbit decompression");
+ 
+         /* decompress the buffer */
+-        if (H5Z__nbit_decompress(outbuf, d_nelmts, (unsigned char *)*buf, cd_values) < 0) {
++        if (H5Z__nbit_decompress(outbuf, d_nelmts, (unsigned char *)*buf, nbytes, cd_values, cd_nelmts) < 0) {
+             H5MM_xfree(outbuf);
+             HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, 0, "can't decompress buffer");
+         }
+@@ -999,15 +1030,19 @@ H5Z__nbit_next_byte(size_t *j, size_t *buf_len)
+     *buf_len = 8 * sizeof(unsigned char);
+ }
+ 
+-static void
++static herr_t
+ H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
+-                              unsigned end_i, const unsigned char *buffer, size_t *j, size_t *buf_len,
+-                              const parms_atomic *p, size_t datatype_len)
++                              unsigned end_i, const unsigned char *buffer, size_t buffer_size, size_t *j,
++                              size_t *buf_len, const parms_atomic *p, size_t datatype_len)
+ {
+     size_t        dat_len; /* dat_len is the number of bits to be copied in each data byte */
+     size_t        dat_offset;
+     unsigned char val; /* value to be copied in each data byte */
+ 
++    /* Ensure the byte to be read is within the bounds of the compressed buffer */
++    if (*j >= buffer_size)
++        return FAIL;
++
+     /* initialize value and bits of unsigned char to be copied */
+     val        = buffer[*j];
+     dat_offset = 0;
+@@ -1039,25 +1074,33 @@ H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned
+         dat_len -= *buf_len;
+         H5Z__nbit_next_byte(j, buf_len);
+         if (dat_len == 0)
+-            return;
++            return SUCCEED;
+ 
++        if (*j >= buffer_size)
++            return FAIL;
+         val = buffer[*j];
+         data[data_offset + k] |= (unsigned char)(((unsigned)(val >> (*buf_len - dat_len)) &
+                                                   (unsigned)(~((unsigned)(~0) << dat_len)))
+                                                  << dat_offset);
+         *buf_len -= dat_len;
+     }
++
++    return SUCCEED;
+ }
+ 
+-static void
++static herr_t
+ H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, const unsigned char *buffer,
+-                                  size_t *j, size_t *buf_len, unsigned size)
++                                  size_t buffer_size, size_t *j, size_t *buf_len, unsigned size)
+ {
+     unsigned      i;       /* index */
+     size_t        dat_len; /* dat_len is the number of bits to be copied in each data byte */
+     unsigned char val;     /* value to be copied in each data byte */
+ 
+     for (i = 0; i < size; i++) {
++        /* Ensure the byte to be read is within the bounds of the compressed buffer */
++        if (*j >= buffer_size)
++            return FAIL;
++
+         /* initialize value and bits of unsigned char to be copied */
+         val     = buffer[*j];
+         dat_len = sizeof(unsigned char) * 8;
+@@ -1069,16 +1112,20 @@ H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, const
+         if (dat_len == 0)
+             continue;
+ 
++        if (*j >= buffer_size)
++            return FAIL;
+         val = buffer[*j];
+         data[data_offset + i] |= (unsigned char)((unsigned)(val >> (*buf_len - dat_len)) &
+                                                  (unsigned)(~((unsigned)(~0) << dat_len)));
+         *buf_len -= dat_len;
+     }
++
++    return SUCCEED;
+ }
+ 
+-static void
+-H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j,
+-                                size_t *buf_len, const parms_atomic *p)
++static herr_t
++H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer,
++                                size_t buffer_size, size_t *j, size_t *buf_len, const parms_atomic *p)
+ {
+     /* begin_i: the index of byte having first significant bit
+        end_i: the index of byte having last significant bit */
+@@ -1097,8 +1144,9 @@ H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigne
+         end_i = p->offset / 8;
+ 
+         for (k = (int)begin_i; k >= (int)end_i; k--)
+-            H5Z__nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len,
+-                                          p, datatype_len);
++            if (H5Z__nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer,
++                                              buffer_size, j, buf_len, p, datatype_len) < 0)
++                return FAIL;
+     }
+     else { /* big endian */
+         /* Sanity check */
+@@ -1112,14 +1160,18 @@ H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigne
+             end_i = ((unsigned)datatype_len - p->offset) / 8 - 1;
+ 
+         for (k = (int)begin_i; k <= (int)end_i; k++)
+-            H5Z__nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len,
+-                                          p, datatype_len);
++            if (H5Z__nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer,
++                                              buffer_size, j, buf_len, p, datatype_len) < 0)
++                return FAIL;
+     }
++
++    return SUCCEED;
+ }
+ 
+ static herr_t
+-H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j,
+-                               size_t *buf_len, const unsigned parms[], unsigned *parms_index)
++H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer,
++                               size_t buffer_size, size_t *j, size_t *buf_len, const unsigned parms[],
++                               size_t parms_nelmts, unsigned *parms_index)
+ {
+     unsigned     i, total_size, base_class, base_size, n, begin_index;
+     parms_atomic p;
+@@ -1127,11 +1179,19 @@ H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned
+ 
+     FUNC_ENTER_PACKAGE
+ 
++    if (!H5Z_NBIT_PARMS_AVAIL(*parms_index, 2, parms_nelmts))
++        HGOTO_ERROR(H5E_PLINE, H5E_OVERFLOW, FAIL,
++                    "parameter list is shorter than the datatype it describes");
++
+     total_size = parms[(*parms_index)++];
+     base_class = parms[(*parms_index)++];
+ 
+     switch (base_class) {
+         case H5Z_NBIT_ATOMIC:
++            if (!H5Z_NBIT_PARMS_AVAIL(*parms_index, 4, parms_nelmts))
++                HGOTO_ERROR(H5E_PLINE, H5E_OVERFLOW, FAIL,
++                            "parameter list is shorter than the datatype it describes");
++
+             p.size      = parms[(*parms_index)++];
+             p.order     = parms[(*parms_index)++];
+             p.precision = parms[(*parms_index)++];
+@@ -1143,37 +1203,54 @@ H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned
+ 
+             n = total_size / p.size;
+             for (i = 0; i < n; i++)
+-                H5Z__nbit_decompress_one_atomic(data, data_offset + i * (size_t)p.size, buffer, j, buf_len,
+-                                                &p);
++                if (H5Z__nbit_decompress_one_atomic(data, data_offset + i * (size_t)p.size, buffer,
++                                                    buffer_size, j, buf_len, &p) < 0)
++                    HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress atomic");
+             break;
+ 
+         case H5Z_NBIT_ARRAY:
++            if (!H5Z_NBIT_PARMS_AVAIL(*parms_index, 1, parms_nelmts))
++                HGOTO_ERROR(H5E_PLINE, H5E_OVERFLOW, FAIL,
++                            "parameter list is shorter than the datatype it describes");
++
+             base_size   = parms[*parms_index];    /* read in advance */
+             n           = total_size / base_size; /* number of base_type elements inside the array datatype */
+             begin_index = *parms_index;
+             for (i = 0; i < n; i++) {
+-                if (H5Z__nbit_decompress_one_array(data, data_offset + i * (size_t)base_size, buffer, j,
+-                                                   buf_len, parms, parms_index) < 0)
++                if (H5Z__nbit_decompress_one_array(data, data_offset + i * (size_t)base_size, buffer,
++                                                   buffer_size, j, buf_len, parms, parms_nelmts,
++                                                   parms_index) < 0)
+                     HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress array");
+                 *parms_index = begin_index;
+             }
+             break;
+ 
+         case H5Z_NBIT_COMPOUND:
++            if (!H5Z_NBIT_PARMS_AVAIL(*parms_index, 1, parms_nelmts))
++                HGOTO_ERROR(H5E_PLINE, H5E_OVERFLOW, FAIL,
++                            "parameter list is shorter than the datatype it describes");
++
+             base_size   = parms[*parms_index];    /* read in advance */
+             n           = total_size / base_size; /* number of base_type elements inside the array datatype */
+             begin_index = *parms_index;
+             for (i = 0; i < n; i++) {
+-                if (H5Z__nbit_decompress_one_compound(data, data_offset + i * (size_t)base_size, buffer, j,
+-                                                      buf_len, parms, parms_index) < 0)
++                if (H5Z__nbit_decompress_one_compound(data, data_offset + i * (size_t)base_size, buffer,
++                                                      buffer_size, j, buf_len, parms, parms_nelmts,
++                                                      parms_index) < 0)
+                     HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress compound");
+                 *parms_index = begin_index;
+             }
+             break;
+ 
+         case H5Z_NBIT_NOOPTYPE:
++            if (!H5Z_NBIT_PARMS_AVAIL(*parms_index, 1, parms_nelmts))
++                HGOTO_ERROR(H5E_PLINE, H5E_OVERFLOW, FAIL,
++                            "parameter list is shorter than the datatype it describes");
++
+             (*parms_index)++; /* skip size of no-op type */
+-            H5Z__nbit_decompress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size);
++            if (H5Z__nbit_decompress_one_nooptype(data, data_offset, buffer, buffer_size, j, buf_len,
++                                                  total_size) < 0)
++                HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress no-op type");
+             break;
+ 
+         default:
+@@ -1185,8 +1262,9 @@ done:
+ }
+ 
+ static herr_t
+-H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j,
+-                                  size_t *buf_len, const unsigned parms[], unsigned *parms_index)
++H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, unsigned char *buffer,
++                                  size_t buffer_size, size_t *j, size_t *buf_len, const unsigned parms[],
++                                  size_t parms_nelmts, unsigned *parms_index)
+ {
+     unsigned     i, nmembers, member_offset, member_class, member_size, used_size = 0, prev_used_size, size;
+     parms_atomic p;
+@@ -1194,10 +1272,18 @@ H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, unsig
+ 
+     FUNC_ENTER_PACKAGE
+ 
++    if (!H5Z_NBIT_PARMS_AVAIL(*parms_index, 2, parms_nelmts))
++        HGOTO_ERROR(H5E_PLINE, H5E_OVERFLOW, FAIL,
++                    "parameter list is shorter than the datatype it describes");
++
+     size     = parms[(*parms_index)++];
+     nmembers = parms[(*parms_index)++];
+ 
+     for (i = 0; i < nmembers; i++) {
++        if (!H5Z_NBIT_PARMS_AVAIL(*parms_index, 3, parms_nelmts))
++            HGOTO_ERROR(H5E_PLINE, H5E_OVERFLOW, FAIL,
++                        "parameter list is shorter than the datatype it describes");
++
+         member_offset = parms[(*parms_index)++];
+         member_class  = parms[(*parms_index)++];
+ 
+@@ -1213,6 +1299,10 @@ H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, unsig
+             HGOTO_ERROR(H5E_PLINE, H5E_BADRANGE, FAIL, "compound member offset overflowed compound size");
+         switch (member_class) {
+             case H5Z_NBIT_ATOMIC:
++                if (!H5Z_NBIT_PARMS_AVAIL(*parms_index, 4, parms_nelmts))
++                    HGOTO_ERROR(H5E_PLINE, H5E_OVERFLOW, FAIL,
++                                "parameter list is shorter than the datatype it describes");
++
+                 p.size = member_size;
+                 /* Advance past member size */
+                 (*parms_index)++;
+@@ -1224,26 +1314,29 @@ H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, unsig
+                 if (p.precision > p.size * 8 || (p.precision + p.offset) > p.size * 8)
+                     HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "invalid datatype precision/offset");
+ 
+-                H5Z__nbit_decompress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, &p);
++                if (H5Z__nbit_decompress_one_atomic(data, data_offset + member_offset, buffer, buffer_size, j,
++                                                    buf_len, &p) < 0)
++                    HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress atomic");
+                 break;
+ 
+             case H5Z_NBIT_ARRAY:
+-                if (H5Z__nbit_decompress_one_array(data, data_offset + member_offset, buffer, j, buf_len,
+-                                                   parms, parms_index) < 0)
++                if (H5Z__nbit_decompress_one_array(data, data_offset + member_offset, buffer, buffer_size, j,
++                                                   buf_len, parms, parms_nelmts, parms_index) < 0)
+                     HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress array");
+                 break;
+ 
+             case H5Z_NBIT_COMPOUND:
+-                if (H5Z__nbit_decompress_one_compound(data, data_offset + member_offset, buffer, j, buf_len,
+-                                                      parms, parms_index) < 0)
++                if (H5Z__nbit_decompress_one_compound(data, data_offset + member_offset, buffer, buffer_size,
++                                                      j, buf_len, parms, parms_nelmts, parms_index) < 0)
+                     HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress compound");
+                 break;
+ 
+             case H5Z_NBIT_NOOPTYPE:
+-                /* Advance past member size */
++                /* Advance past member size (already checked above) */
+                 (*parms_index)++;
+-                H5Z__nbit_decompress_one_nooptype(data, data_offset + member_offset, buffer, j, buf_len,
+-                                                  member_size);
++                if (H5Z__nbit_decompress_one_nooptype(data, data_offset + member_offset, buffer, buffer_size,
++                                                      j, buf_len, member_size) < 0)
++                    HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress no-op type");
+                 break;
+ 
+             default:
+@@ -1256,7 +1349,8 @@ done:
+ }
+ 
+ static herr_t
+-H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, const unsigned parms[])
++H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t buffer_size,
++                     const unsigned parms[], size_t parms_nelmts)
+ {
+     /* i: index of data, j: index of buffer,
+        buf_len: number of bits to be filled in current byte */
+@@ -1269,6 +1363,11 @@ H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buff
+ 
+     FUNC_ENTER_PACKAGE
+ 
++    /* The datatype class and its size are read before the walk begins */
++    if (!H5Z_NBIT_PARMS_AVAIL(0, 5, parms_nelmts))
++        HGOTO_ERROR(H5E_PLINE, H5E_OVERFLOW, FAIL,
++                    "parameter list is shorter than the datatype it describes");
++
+     /* may not have to initialize to zeros */
+     memset(data, 0, d_nelmts * (size_t)parms[4]);
+ 
+@@ -1278,6 +1377,10 @@ H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buff
+ 
+     switch (parms[3]) {
+         case H5Z_NBIT_ATOMIC:
++            if (!H5Z_NBIT_PARMS_AVAIL(0, 8, parms_nelmts))
++                HGOTO_ERROR(H5E_PLINE, H5E_OVERFLOW, FAIL,
++                            "parameter list is shorter than the datatype it describes");
++
+             p.size      = parms[4];
+             p.order     = parms[5];
+             p.precision = parms[6];
+@@ -1288,15 +1391,17 @@ H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buff
+                 HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "invalid datatype precision/offset");
+ 
+             for (i = 0; i < d_nelmts; i++)
+-                H5Z__nbit_decompress_one_atomic(data, i * (size_t)p.size, buffer, &j, &buf_len, &p);
++                if (H5Z__nbit_decompress_one_atomic(data, i * (size_t)p.size, buffer, buffer_size, &j,
++                                                    &buf_len, &p) < 0)
++                    HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress atomic");
+             break;
+ 
+         case H5Z_NBIT_ARRAY:
+             size        = parms[4];
+             parms_index = 4; /* set the index before goto function call */
+             for (i = 0; i < d_nelmts; i++) {
+-                if (H5Z__nbit_decompress_one_array(data, i * size, buffer, &j, &buf_len, parms,
+-                                                   &parms_index) < 0)
++                if (H5Z__nbit_decompress_one_array(data, i * size, buffer, buffer_size, &j, &buf_len, parms,
++                                                   parms_nelmts, &parms_index) < 0)
+                     HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress array");
+                 parms_index = 4;
+             }
+@@ -1306,8 +1411,8 @@ H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buff
+             size        = parms[4];
+             parms_index = 4; /* set the index before goto function call */
+             for (i = 0; i < d_nelmts; i++) {
+-                if (H5Z__nbit_decompress_one_compound(data, i * size, buffer, &j, &buf_len, parms,
+-                                                      &parms_index) < 0)
++                if (H5Z__nbit_decompress_one_compound(data, i * size, buffer, buffer_size, &j, &buf_len,
++                                                      parms, parms_nelmts, &parms_index) < 0)
+                     HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "can't decompress compound");
+                 parms_index = 4;
+             }
meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb +1 -0
index cf199375d3..1ec5ad049e 100644
@@ -22,6 +22,7 @@ SRC_URI = "https://support.hdfgroup.org/releases/hdf5/v2_0/v2_0_0/downloads/${BP
            file://CVE-2026-17573.patch \
            file://CVE-2026-17574.patch \
            file://CVE-2026-19025.patch \
+           file://CVE-2026-19026-CVE-2026-19027-CVE-2026-19028.patch \
            "
 SRC_URI[sha256sum] = "f4c2edc5668fb846627182708dbe1e16c60c467e63177a75b0b9f12c19d7efed"
 
#1 lore raw

PATCH 2/14 hdf5: patch CVE-2026-19023 and CVE-2026-19024

From: Ankur Tyagi <[email protected]>

Details:
https://nvd.nist.gov/vuln/detail/cve-2026-19023
https://nvd.nist.gov/vuln/detail/cve-2026-19024

---
 .../files/CVE-2026-19023-CVE-2026-19024.patch | 176 ++++++++++++++++++
 meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb    |   1 +
 2 files changed, 177 insertions(+)
 create mode 100644 meta-oe/recipes-support/hdf5/files/CVE-2026-19023-CVE-2026-19024.patch
meta-oe/recipes-support/hdf5/files/CVE-2026-19023-CVE-2026-19024.patch new file +176 -0
new file mode 100644
index 0000000000..acf3817ea1
@@ -0,0 +1,176 @@
+From e7e85949865b771b2b0b73ac1edaf54ce14cd894 Mon Sep 17 00:00:00 2001
+From: Matt L <[email protected]>
+Date: Wed, 7 Oct 2026 11:03:55 -0500
+Subject: [PATCH] Fix CVEs related to vlen binary output and malformed fill
+ values in h5dump (#6507)
+
+* Fix h5dump SIGSEGVs on vlen binary output and malformed fill value
+
+Fixes two crafted-file crashes in h5dump (GitHub issues #6486 and #6487).
+A third report (#6488) is the Fletcher32 checksum-length underflow already
+fixed for h5ls in PR #6497, so it is not addressed again here.
+
+Issue #6486 (tools) - render_bin_output() SIGSEGV with "-b" on a
+variable-length string dataset. The H5T_STRING branch reused the local
+"size" variable both as the per-element stride and as the string length
+returned by strlen(), so after the first element the stride became that
+string's length and subsequent elements were read from misaligned
+addresses, dereferencing a garbage pointer. This affected any multi-element
+vlen-string dataset, not just crafted files. A separate str_len variable is
+now used for the write length so "size" stays the datatype stride. As this
+is a tools bug, the regression test is a tools test: tools/test/h5dump adds
+the tbinvlstr case (binary dump of a vlen-string dataset, file
+tbinvlstr.h5, generated by h5dumpgentest.c/gent_binvlstr), which crashes on
+develop and passes with the fix.
+
+Issue #6487 (library) - H5Pget_fill_value() SIGSEGV via H5T_path_find().
+A crafted version-1/2 fill value message can have "fill defined" set with a
+negative size field; H5O_fill_old_decode() leaves fill.size negative and
+fill.buf/type NULL instead of normalizing to the "undefined" sentinel.
+That value is neither 0 nor -1, so H5P_get_fill_value() fell through to
+H5T_path_find() with a NULL source type and crashed. H5P_get_fill_value()
+now rejects a NULL fill datatype and returns an error, keeping the dataset
+itself readable. h5dump's XML fill-value renderer (xml_dump_fill_value) is
+also hardened: it checks the buffer allocation and the H5Pget_fill_value()
+return value and emits an empty fill value element instead of dereferencing
+an unallocated or unretrievable buffer.
+
+Regression test (library): test/fillval.c test_bad_fill_value() reads a
+crafted file (generated by test/gen_bad_fill.c, committed as
+test/testfiles/bad_fill_value.h5) and verifies that the dataset data is
+still readable while H5Pget_fill_value() fails cleanly instead of crashing.
+
+Verified: both PoCs exit cleanly with the fix (SIGSEGV without it); the
+committed fixtures crash the pre-fix library/tools and pass post-fix; the
+fillval suite, the new tbinvlstr h5dump test, and the non-XML h5dump suite
+pass.
+
+Co-Authored-By: Claude Opus 4.8 <[email protected]>
+
+* Update CHANGELOG to list CVEs/GH issues
+
+* Renumber tbinvlstr.h5 generator macro to FILE114
+
+---------
+
+Co-authored-by: Claude Opus 4.8 <[email protected]>
+Co-authored-by: Larry Knox <[email protected]>
+
+CVE: CVE-2026-19023 CVE-2026-19024
+Upstream-Status: Backport [https://github.com/HDFGroup/hdf5/commit/cfcd7fe7421cc94e0527d043f2d1b271986e7b09]
+
+Dropped changes to the test and CHANGELOG file.
+
+Signed-off-by: Ankur Tyagi <[email protected]>
+---
+ src/H5Pdcpl.c                 |  7 +++++++
+ tools/lib/h5tools.c           |  9 ++++++---
+ tools/src/h5dump/h5dump_xml.c | 33 ++++++++++++++++++++++++++++-----
+ 3 files changed, 41 insertions(+), 8 deletions(-)
+
+diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
+index 2317c317f73..a1a33d52c7b 100644
+--- a/src/H5Pdcpl.c
++++ b/src/H5Pdcpl.c
+@@ -3207,6 +3207,13 @@ H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value /*out*/
+         HGOTO_DONE(SUCCEED);
+     } /* end if */
+ 
++    /*
++     * A fill value with a nonzero size must have an associated datatype in
++     * order to be converted to the destination type.
++     */
++    if (NULL == fill.type)
++        HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "fill value has no datatype");
++
+     /*
+      * Can we convert between the source and destination datatypes?
+      */
+diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
+index b1a2aa0de4c..3e028504f7c 100644
+--- a/tools/lib/h5tools.c
++++ b/tools/lib/h5tools.c
+@@ -1825,24 +1825,27 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
+             H5T_str_t     pad;
+             char         *s = NULL;
+             unsigned char tempuchar;
++            size_t        str_len; /* # of bytes to write for this element */
+ 
+             H5TOOLS_DEBUG("H5T_STRING");
+             pad = H5Tget_strpad(tid);
+ 
+             for (block_index = 0; block_index < block_nelmts; block_index++) {
++                /* Advance by the datatype size */
+                 mem = ((unsigned char *)_mem) + block_index * size;
+ 
+                 if (H5Tis_variable_str(tid)) {
+                     s = *(char **)((void *)mem);
+                     if (s != NULL)
+-                        size = strlen(s);
++                        str_len = strlen(s);
+                     else
+                         H5TOOLS_THROW((-1), "NULL string");
+                 }
+                 else {
+-                    s = (char *)mem;
++                    s       = (char *)mem;
++                    str_len = size;
+                 }
+-                for (i = 0; i < size && (s[i] || pad != H5T_STR_NULLTERM); i++) {
++                for (i = 0; i < str_len && (s[i] || pad != H5T_STR_NULLTERM); i++) {
+                     memcpy(&tempuchar, &s[i], sizeof(unsigned char));
+                     if (1 != fwrite(&tempuchar, sizeof(unsigned char), 1, stream))
+                         H5TOOLS_THROW((-1), "fwrite failed");
+diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c
+index f1a34870f4a..6f3e00a27df 100644
+--- a/tools/src/h5dump/h5dump_xml.c
++++ b/tools/src/h5dump/h5dump_xml.c
+@@ -3534,8 +3534,9 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
+     hid_t             n_type = H5I_INVALID_HID;
+     void             *buf;
+     char             *name;
+-    h5tools_str_t     buffer; /* string into which to render   */
+-    h5tools_context_t ctx;    /* print context  */
++    herr_t            fill_ret = FAIL; /* status of retrieving the fill value */
++    h5tools_str_t     buffer;          /* string into which to render   */
++    h5tools_context_t ctx;             /* print context  */
+     h5tool_format_t  *outputformat = &xml_dataformat;
+     h5tool_format_t   string_dataformat;
+     hsize_t           curr_pos = 0; /* total data element position   */
+@@ -3593,11 +3594,33 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
+         n_type = type;
+ 
+     space = H5Tget_size(n_type);
+-    buf   = malloc((size_t)space);
++    /* Zero-initialize so a partially-filled buffer never contains
++     * uninitialized memory for the rendering code below. */
++    buf = calloc((size_t)space, 1);
++
++    /* Retrieve the fill value.  This can fail on a corrupted or crafted file
++     * whose fill value has no datatype. Any errors are suppressed and handled
++     * later. */
++    if (buf != NULL) {
++        H5E_BEGIN_TRY
++        {
++            fill_ret = H5Pget_fill_value(dcpl, n_type, buf);
++        }
++        H5E_END_TRY
++    }
+ 
+-    H5Pget_fill_value(dcpl, n_type, buf);
++    if (buf == NULL || fill_ret < 0) {
++        /* No usable fill value: emit an empty element rather than
++         * dereferencing an unallocated or unretrievable buffer. */
++        ctx.need_prefix = true;
+ 
+-    if (H5Tget_class(n_type) == H5T_REFERENCE) {
++        /* Render the element */
++        h5tools_str_reset(&buffer);
++        h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix);
++        h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
++                               (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
++    }
++    else if (H5Tget_class(n_type) == H5T_REFERENCE) {
+         const char *path = lookup_ref_path(*(H5R_ref_t *)buf);
+ 
+         ctx.need_prefix = true;
meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb +1 -0
index 1ec5ad049e..31a56bce3c 100644
@@ -23,6 +23,7 @@ SRC_URI = "https://support.hdfgroup.org/releases/hdf5/v2_0/v2_0_0/downloads/${BP
            file://CVE-2026-17574.patch \
            file://CVE-2026-19025.patch \
            file://CVE-2026-19026-CVE-2026-19027-CVE-2026-19028.patch \
+           file://CVE-2026-19023-CVE-2026-19024.patch \
            "
 SRC_URI[sha256sum] = "f4c2edc5668fb846627182708dbe1e16c60c467e63177a75b0b9f12c19d7efed"
 
#2 lore raw

PATCH 3/14 hdf5: patch CVE-2026-120689

In reply to [email protected]

From: Ankur Tyagi <[email protected]>

Details:
https://nvd.nist.gov/vuln/detail/cve-2026-120689

---
 .../hdf5/files/CVE-2026-120689.patch          | 60 +++++++++++++++++++
 meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb    |  1 +
 2 files changed, 61 insertions(+)
 create mode 100644 meta-oe/recipes-support/hdf5/files/CVE-2026-120689.patch
meta-oe/recipes-support/hdf5/files/CVE-2026-120689.patch new file +60 -0
new file mode 100644
index 0000000000..dd9e9374ac
@@ -0,0 +1,60 @@
+From 0472315404dc03d0e89eec4513eb80930f9b176e Mon Sep 17 00:00:00 2001
+From: PGZXB <[email protected]>
+Date: Fri, 9 Oct 2026 02:52:55 +0800
+Subject: [PATCH] Fix StackOverflow when calling `H5Gget_info` (#6685)
+
+Verify B-tree node level when an expected level value is provided
+
+(cherry picked from commit 5933130b610c7bd6e66fe93c2798b97e3f3188c8)
+
+CVE: CVE-2026-120689
+Upstream-Status: Backport [https://github.com/HDFGroup/hdf5/commit/5933130b610c7bd6e66fe93c2798b97e3f3188c8]
+
+Signed-off-by: Ankur Tyagi <[email protected]>
+---
+ release_docs/CHANGELOG.md |  6 ++++++
+ src/H5B.c                 | 14 ++++++++++++++
+ 2 files changed, 20 insertions(+)
+
+diff --git a/release_docs/CHANGELOG.md b/release_docs/CHANGELOG.md
+index c181f174bbb..b5c99cd4b16 100644
+--- a/release_docs/CHANGELOG.md
++++ b/release_docs/CHANGELOG.md
+@@ -778,6 +778,12 @@ Added Fortran wrapper `h5fdsubfiling_get_file_mapping_f()` for the subfiling fil
+ 
+    A malformed HDF5 file could have an attribute with a recorded name length of zero.This would lead to an overflow and an invalid memory access. An integrity check has been added to detect this case and safely stop file decoding.
+ 
++### Fixed a stack overflow when iterating a corrupted B-tree
++
++   `H5B__iterate_helper()` now verifies that a B-tree node it has just protected has the level the traversal expects, when the expected level is known. The equivalent check in `H5B__cache_deserialize()` only runs when a node is first loaded into the metadata cache, so a corrupted B-tree whose child pointer revisits a node that is already cached (for example, a node that points to itself) could bypass that check and recurse without bound until the stack was exhausted. Such a file is now rejected with an error instead of crashing. This was observed through `H5Gget_info()`.
++
++   Fixes GitHub issue #6403
++
+ ## Java Library
+ 
+ ### Renamed the Callbacks.java file to H5Callbacks.java
+diff --git a/src/H5B.c b/src/H5B.c
+index c9571708b73..4c6b1a55480 100644
+--- a/src/H5B.c
++++ b/src/H5B.c
+@@ -1140,6 +1140,20 @@ H5B__iterate_helper(H5F_t *f, const H5B_class_t *type, haddr_t addr, int exp_lev
+     if (NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG)))
+         HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to load B-tree node");
+ 
++    /* Check for a corrupted B-tree node.  If the caller has told us what
++     * level to expect, verify that the node we just protected actually has
++     * that level.  This check must be performed here rather than relying
++     * solely on the equivalent check in H5B__cache_deserialize, because
++     * that deserialize callback only runs when a node is first loaded into
++     * the metadata cache.  A corrupted B-tree whose child pointer revisits
++     * a node that is already cached (e.g. a node that points to itself)
++     * bypasses the deserialize callback entirely, so without this check the
++     * recursion below would never terminate and would overflow the stack.
++     */
++    if (exp_level != H5B_UNKNOWN_NODELEVEL && bt->level != (unsigned)exp_level)
++        HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, H5_ITER_ERROR,
++                    "B-tree node level is not as expected, possibly corrupted");
++
+     /* Iterate over node's children */
+     for (u = 0; u < bt->nchildren && ret_value == H5_ITER_CONT; u++) {
+         if (bt->level > 0)
meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb +1 -0
index 31a56bce3c..ea2ce9747c 100644
@@ -24,6 +24,7 @@ SRC_URI = "https://support.hdfgroup.org/releases/hdf5/v2_0/v2_0_0/downloads/${BP
            file://CVE-2026-19025.patch \
            file://CVE-2026-19026-CVE-2026-19027-CVE-2026-19028.patch \
            file://CVE-2026-19023-CVE-2026-19024.patch \
+           file://CVE-2026-120689.patch \
            "
 SRC_URI[sha256sum] = "f4c2edc5668fb846627182708dbe1e16c60c467e63177a75b0b9f12c19d7efed"
 
#3 lore raw

PATCH 4/14 hdf5: patch CVE-2026-120754 and CVE-2026-120755

In reply to [email protected]

From: Ankur Tyagi <[email protected]>

Details:
https://nvd.nist.gov/vuln/detail/cve-2026-120754
https://nvd.nist.gov/vuln/detail/cve-2026-120755

---
 .../CVE-2026-120754-CVE-2026-120755.patch     | 172 ++++++++++++++++++
 meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb    |   1 +
 2 files changed, 173 insertions(+)
 create mode 100644 meta-oe/recipes-support/hdf5/files/CVE-2026-120754-CVE-2026-120755.patch
meta-oe/recipes-support/hdf5/files/CVE-2026-120754-CVE-2026-120755.patch new file +172 -0
new file mode 100644
index 0000000000..3f0a8d69d5
@@ -0,0 +1,172 @@
+From 78672660618de8cca7c804f465886af02a89e79b Mon Sep 17 00:00:00 2001
+From: Matt L <[email protected]>
+Date: Wed, 21 Oct 2026 13:52:39 -0500
+Subject: [PATCH] Bound filter header reads to the stored chunk length (#6585)
+
+* bound scaleoffset and fletcher32 reads to the chunk buffer
+
+* Bound filter header reads to the stored chunk length
+
+This PR is an expansion of #6579.
+
+The scaleoffset bounds checks measured against *buf_size, the size of the
+chunk buffer, rather than nbytes, the number of bytes the pipeline read from
+the file. H5D__chunk_lock() sizes a filtered chunk buffer to MAX(stored size,
+unfiltered size) so filters have room to expand into, and fills only the
+stored bytes, so the buffer is routinely longer than the data in it. A
+truncated chunk therefore passed the header check and decompressed out of the
+uninitialized remainder of the allocation, returning unrelated heap contents
+as dataset data. Because the reads stay inside the allocation, the address
+sanitizer does not see them.
+
+This PR switches every read-side check in H5Z__filter_scaleoffset()
+to bound against nbytes and pass the stored length to
+H5Z__scaleoffset_decompress().
+
+Similar short-chunk checks are added to szip and fletcher32.
+
+The direct chunk test has been extended to cover a chunk whose unfiltered size is
+larger than the bytes stored for it, and to cover szip.
+
+* Correct potential invalid pointer usage
+
+* update CHANGELOG
+
+* Update CHANGELOG comment
+
+* Guard scaleoffset output size against multiplication overflow
+
+---------
+
+Co-authored-by: Nayyar <[email protected]>
+Co-authored-by: Larry Knox <[email protected]>
+
+CVE: CVE-2026-120754 CVE-2026-120755
+Upstream-Status: Backport [https://github.com/HDFGroup/hdf5/commit/cdb13c4de9c7edbbae180f384e2e610a3b3cf185]
+
+Dropped changes to the test and CHANGELOG file.
+
+Signed-off-by: Ankur Tyagi <[email protected]>
+---
+ src/H5Zfletcher32.c  | 13 +++++++------
+ src/H5Zscaleoffset.c | 15 +++++++++++----
+ src/H5Zszip.c        | 18 ++++++++++++++----
+ 3 files changed, 32 insertions(+), 14 deletions(-)
+
+diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c
+index b89724ad0a3..5ef3b04cbcf 100644
+--- a/src/H5Zfletcher32.c
++++ b/src/H5Zfletcher32.c
+@@ -62,13 +62,14 @@ H5Z__filter_fletcher32(unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts,
+     assert(sizeof(uint32_t) >= 4);
+ 
+     if (flags & H5Z_FLAG_REVERSE) { /* Read */
+-        /* A Fletcher32-filtered buffer must contain at least the trailing
+-         * checksum.  Reject anything smaller to avoid a size_t underflow
+-         * when computing the data length.
++        /* The checksum is stored at the end of the chunk, so anything shorter
++         * than the checksum itself makes the length arithmetic below wrap.  A
++         * chunk of exactly FLETCHER_LEN bytes holds no data and would return a
++         * filtered size of zero, which the pipeline reports as a filter failure,
++         * so reject it here where the reason can be stated.
+          */
+-        if (nbytes < FLETCHER_LEN)
+-            HGOTO_ERROR(H5E_STORAGE, H5E_OVERFLOW, 0,
+-                        "fletcher32 filter input buffer too small to contain checksum");
++        if (nbytes <= FLETCHER_LEN)
++            HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "buffer too short");
+ 
+         /* Do checksum if it's enabled for read; otherwise skip it
+          * to save performance. */
+diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
+index d39b4f40403..d506e5203a0 100644
+--- a/src/H5Zscaleoffset.c
++++ b/src/H5Zscaleoffset.c
+@@ -1205,10 +1205,18 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu
+         unsigned long long minval_mask  = 0;
+         unsigned           minval_size  = 0;
+ 
+-        minbits = 0;
+-        if (H5_IS_BUFFER_OVERFLOW((unsigned char *)*buf, 5, (unsigned char *)*buf + *buf_size - 1))
++        /* Bound every read below by nbytes rather than *buf_size.  The caller may
++         * provide a buffer larger than the data it holds, so restrict the read
++         * to the valid nbytes.
++         */
++        /* The minbits and minval-size fields are the first five bytes of the
++         * stream, so validate that length before deriving an end-of-buffer
++         * pointer from nbytes
++         */
++        if (nbytes < 5)
+             HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "buffer too short");
+ 
++        minbits = 0;
+         for (i = 0; i < 4; i++) {
+             minbits_mask = ((unsigned char *)*buf)[i];
+             minbits_mask <<= i * 8;
+@@ -1224,8 +1232,7 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu
+         minval_size = sizeof(unsigned long long) <= ((unsigned char *)*buf)[4] ? sizeof(unsigned long long)
+                                                                                : ((unsigned char *)*buf)[4];
+         minval      = 0;
+-        if (H5_IS_BUFFER_OVERFLOW((unsigned char *)*buf, 5 + minval_size,
+-                                  (unsigned char *)*buf + *buf_size - 1))
++        if (H5_IS_BUFFER_OVERFLOW((unsigned char *)*buf, 5 + minval_size, (unsigned char *)*buf + nbytes - 1))
+             HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "buffer too short");
+         for (i = 0; i < minval_size; i++) {
+             minval_mask = ((unsigned char *)*buf)[5 + i];
+diff --git a/src/H5Zszip.c b/src/H5Zszip.c
+index 9b37035374f..dd6c3619873 100644
+--- a/src/H5Zszip.c
++++ b/src/H5Zszip.c
+@@ -28,6 +28,9 @@
+ #include "szlib.h"
+ #endif
+ 
++/* Size of the uncompressed-length header stored in front of the szip stream */
++#define SZIP_HEADER_LEN 4
++
+ /* Local function prototypes */
+ static htri_t H5Z__can_apply_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id);
+ static herr_t H5Z__set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id);
+@@ -284,6 +287,13 @@ H5Z__filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], s
+         uint32_t stored_nalloc; /* Number of bytes the compressed block will expand into */
+         size_t   nalloc;        /* Number of bytes the compressed block will expand into */
+ 
++        /* The uncompressed length is stored in front of the compressed stream, so
++         * a chunk shorter than that header makes the length arithmetic below wrap.
++         * A chunk of exactly SZIP_HEADER_LEN bytes holds no compressed data.
++         */
++        if (nbytes <= SZIP_HEADER_LEN)
++            HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "buffer too short");
++
+         /* Get the size of the uncompressed buffer */
+         newbuf = (unsigned char *)(*buf);
+         UINT32DECODE(newbuf, stored_nalloc);
+@@ -295,7 +305,7 @@ H5Z__filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], s
+ 
+         /* Decompress the buffer */
+         size_out = nalloc;
+-        if (SZ_BufftoBuffDecompress(outbuf, &size_out, newbuf, nbytes - 4, &sz_param) != SZ_OK)
++        if (SZ_BufftoBuffDecompress(outbuf, &size_out, newbuf, nbytes - SZIP_HEADER_LEN, &sz_param) != SZ_OK)
+             HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "szip_filter: decompression failed");
+         assert(size_out == nalloc);
+ 
+@@ -313,7 +323,7 @@ H5Z__filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], s
+         unsigned char *dst = NULL; /* Temporary pointer to new output buffer */
+ 
+         /* Allocate space for the compressed buffer & header (assume data won't get bigger) */
+-        if (NULL == (dst = outbuf = (unsigned char *)H5MM_malloc(nbytes + 4)))
++        if (NULL == (dst = outbuf = (unsigned char *)H5MM_malloc(nbytes + SZIP_HEADER_LEN)))
+             HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "unable to allocate szip destination buffer");
+ 
+         /* Encode the uncompressed length */
+@@ -332,8 +342,8 @@ H5Z__filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], s
+         /* Set return values */
+         *buf      = outbuf;
+         outbuf    = NULL;
+-        *buf_size = nbytes + 4;
+-        ret_value = size_out + 4;
++        *buf_size = nbytes + SZIP_HEADER_LEN;
++        ret_value = size_out + SZIP_HEADER_LEN;
+     }
+ 
+ done:
meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb +1 -0
index ea2ce9747c..758baf6e15 100644
@@ -25,6 +25,7 @@ SRC_URI = "https://support.hdfgroup.org/releases/hdf5/v2_0/v2_0_0/downloads/${BP
            file://CVE-2026-19026-CVE-2026-19027-CVE-2026-19028.patch \
            file://CVE-2026-19023-CVE-2026-19024.patch \
            file://CVE-2026-120689.patch \
+           file://CVE-2026-120754-CVE-2026-120755.patch \
            "
 SRC_URI[sha256sum] = "f4c2edc5668fb846627182708dbe1e16c60c467e63177a75b0b9f12c19d7efed"
 
#4 lore raw

PATCH 5/14 hdf5: patch CVE-2026-120756

In reply to [email protected]

From: Ankur Tyagi <[email protected]>

Details:
https://nvd.nist.gov/vuln/detail/cve-2026-120756

---
 .../hdf5/files/CVE-2026-120756.patch          | 45 +++++++++++++++++++
 meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb    |  1 +
 2 files changed, 46 insertions(+)
 create mode 100644 meta-oe/recipes-support/hdf5/files/CVE-2026-120756.patch
meta-oe/recipes-support/hdf5/files/CVE-2026-120756.patch new file +45 -0
new file mode 100644
index 0000000000..28bd658598
@@ -0,0 +1,45 @@
+From 43855883c1ea10a072b7e7cf2dbc5a29ab411a8f Mon Sep 17 00:00:00 2001
+From: Nayyar <[email protected]>
+Date: Sat, 12 Sep 2026 16:37:49 +0530
+Subject: [PATCH] check object header message size after decoding its header
+ (#6589)
+
+(cherry picked from commit 10f1af5528168c5a71a58eba0b486e0677f3aaa3)
+
+CVE: CVE-2026-120756
+Upstream-Status: Backport [https://github.com/HDFGroup/hdf5/commit/10f1af5528168c5a71a58eba0b486e0677f3aaa3]
+
+Dropped changes to the test and CHANGELOG file.
+Signed-off-by: Ankur Tyagi <[email protected]>
+---
+ src/H5Ocache.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/src/H5Ocache.c b/src/H5Ocache.c
+index 8f0928f290e..9dc6a2e21bb 100644
+--- a/src/H5Ocache.c
++++ b/src/H5Ocache.c
+@@ -1270,9 +1270,6 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t chunk_size, const uint8_t
+         if (mesg_size != H5O_ALIGN_OH(oh, mesg_size))
+             HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "message not aligned");
+ 
+-        if (H5_IS_BUFFER_OVERFLOW(chunk_image, mesg_size, p_end))
+-            HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "message size exceeds buffer end");
+-
+         /* Message flags */
+         if (H5_IS_BUFFER_OVERFLOW(chunk_image, 1, p_end))
+             HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, FAIL, "ran off end of input buffer while decoding");
+@@ -1305,6 +1302,13 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t chunk_size, const uint8_t
+             }
+         }
+ 
++        /* The message body starts after the message header, so its size can
++         * only be checked against the buffer once the whole header has been
++         * decoded
++         */
++        if (H5_IS_BUFFER_OVERFLOW(chunk_image, mesg_size, p_end))
++            HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "message size exceeds buffer end");
++
+         /* Increment count of null messages */
+         if (H5O_NULL_ID == id)
+             nullcnt++;
meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb +1 -0
index 758baf6e15..2b89c6925b 100644
@@ -26,6 +26,7 @@ SRC_URI = "https://support.hdfgroup.org/releases/hdf5/v2_0/v2_0_0/downloads/${BP
            file://CVE-2026-19023-CVE-2026-19024.patch \
            file://CVE-2026-120689.patch \
            file://CVE-2026-120754-CVE-2026-120755.patch \
+           file://CVE-2026-120756.patch \
            "
 SRC_URI[sha256sum] = "f4c2edc5668fb846627182708dbe1e16c60c467e63177a75b0b9f12c19d7efed"
 
#5 lore raw

PATCH 6/14 hdf5: patch CVE-2026-120757

In reply to [email protected]

From: Ankur Tyagi <[email protected]>

Details:
https://nvd.nist.gov/vuln/detail/cve-2026-120757

---
 .../hdf5/files/CVE-2026-120757.patch          | 63 +++++++++++++++++++
 meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb    |  1 +
 2 files changed, 64 insertions(+)
 create mode 100644 meta-oe/recipes-support/hdf5/files/CVE-2026-120757.patch
meta-oe/recipes-support/hdf5/files/CVE-2026-120757.patch new file +63 -0
new file mode 100644
index 0000000000..886d6d946b
@@ -0,0 +1,63 @@
+From fa4c737d41c1c86638525a290b5576c8966090d0 Mon Sep 17 00:00:00 2001
+From: Nayyar <[email protected]>
+Date: Thu, 8 Oct 2026 18:57:14 +0530
+Subject: [PATCH] reject malformed external link data in H5L__extern_traverse
+ (#6708)
+
+* validate external link data before parsing in traversal
+
+(cherry picked from commit 8117f4c75fdfb5e759ad73ce62d7ef4584130acd)
+
+CVE: CVE-2026-120757
+Upstream-Status: Backport [https://github.com/HDFGroup/hdf5/commit/8117f4c75fdfb5e759ad73ce62d7ef4584130acd]
+
+Dropped changes to the test and CHANGELOG file.
+
+Signed-off-by: Ankur Tyagi <[email protected]>
+---
+ src/H5Lexternal.c | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c
+index 793825d1c3d..5f874d53177 100644
+--- a/src/H5Lexternal.c
++++ b/src/H5Lexternal.c
+@@ -93,7 +93,7 @@ static const H5L_class_t H5L_EXTERN_LINK_CLASS[1] = {{
+  */
+ static hid_t
+ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, const void *_udata,
+-                     size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id, hid_t H5_ATTR_UNUSED dxpl_id)
++                     size_t udata_size, hid_t lapl_id, hid_t H5_ATTR_UNUSED dxpl_id)
+ {
+     H5P_genplist_t    *plist;                              /* Property list pointer */
+     H5G_loc_t          root_loc;                           /* Location of root group in external file */
+@@ -121,6 +121,18 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, cons
+     /* Sanity checks */
+     assert(p);
+ 
++    /* The udata holds a version/flags byte followed by two NULL-terminated
++     * strings (file name and object path).  The strings are located below with
++     * strlen(), so validate the buffer against udata_size first: it must have
++     * room for both strings and end on a NULL terminator.  A malformed link
++     * from a corrupted file would otherwise read past the udata buffer.  This
++     * matches the checks in H5Lunpack_elink_val().
++     */
++    if (udata_size <= 2)
++        HGOTO_ERROR(H5E_LINK, H5E_CANTDECODE, H5I_INVALID_HID, "external link data too small");
++    if (p[udata_size - 1] != '\0')
++        HGOTO_ERROR(H5E_LINK, H5E_CANTDECODE, H5I_INVALID_HID, "external link data is not NULL-terminated");
++
+     /* Check external link version & flags */
+     if (((*p >> 4) & 0x0F) > H5L_EXT_VERSION)
+         HGOTO_ERROR(H5E_LINK, H5E_CANTDECODE, H5I_INVALID_HID, "bad version number for external link");
+@@ -131,7 +143,9 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, cons
+     /* Gather some information from the external link's user data */
+     file_name = (const char *)p;
+     fname_len = strlen(file_name);
+-    obj_name  = (const char *)p + fname_len + 1;
++    if ((fname_len + 1) >= (udata_size - 1))
++        HGOTO_ERROR(H5E_LINK, H5E_CANTDECODE, H5I_INVALID_HID, "external link data has no object path");
++    obj_name = (const char *)p + fname_len + 1;
+ 
+     /* Get the plist structure */
+     if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS, true)))
meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb +1 -0
index 2b89c6925b..8777345a72 100644
@@ -27,6 +27,7 @@ SRC_URI = "https://support.hdfgroup.org/releases/hdf5/v2_0/v2_0_0/downloads/${BP
            file://CVE-2026-120689.patch \
            file://CVE-2026-120754-CVE-2026-120755.patch \
            file://CVE-2026-120756.patch \
+           file://CVE-2026-120757.patch \
            "
 SRC_URI[sha256sum] = "f4c2edc5668fb846627182708dbe1e16c60c467e63177a75b0b9f12c19d7efed"
 
#6 lore raw

PATCH 7/14 hdf5: patch CVE-2026-120758

In reply to [email protected]

From: Ankur Tyagi <[email protected]>

Details:
https://nvd.nist.gov/vuln/detail/cve-2026-120758

---
 .../hdf5/files/CVE-2026-120758.patch          | 143 ++++++++++++++++++
 meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb    |   1 +
 2 files changed, 144 insertions(+)
 create mode 100644 meta-oe/recipes-support/hdf5/files/CVE-2026-120758.patch
meta-oe/recipes-support/hdf5/files/CVE-2026-120758.patch new file +143 -0
new file mode 100644
index 0000000000..a8fb5f72ff
@@ -0,0 +1,143 @@
+From 277a6bbfdb8e852b7bbd08ae002907fc559e0194 Mon Sep 17 00:00:00 2001
+From: tbeu <[email protected]>
+Date: Sat, 3 Oct 2026 07:43:53 +0200
+Subject: [PATCH] Fix NULL pointer dereferences in H5HL_protect and
+ H5HL_unprotect (#6377)
+
+* Fix NULL pointer dereferences in H5HL_protect and H5HL_unprotect
+
+When reading corrupted HDF5 files, H5HL_protect can encounter a heap
+where prfx->heap is NULL or heap->dblk_image is NULL. Similarly,
+H5HL_unprotect can encounter a heap where heap->prfx or heap->dblk has
+been set to NULL by H5HL__prfx_dest during cache eviction of corrupted
+entries. In both cases, the code proceeded to dereference NULL pointers,
+causing a segfault (found by OSS-Fuzz via matio).
+
+Replace the assert in H5HL_unprotect with proper NULL checks and
+HGOTO_ERROR, and add equivalent guards in H5HL_protect, so corrupted
+files are rejected gracefully instead of crashing.
+
+* Address review: drop speculative H5HL_protect NULL checks, add regression test + changelog
+
+- Remove the NULL checks in H5HL_protect for prfx->heap and heap->dblk_image.
+  prfx->heap is set in H5HL__prfx_new and only cleared in H5HL__prfx_dest (which
+  frees the prefix in the same call), so the check is unreachable and could leak
+  prfx via the done block. heap->dblk_image is NULL by design whenever the data
+  block is not contiguous with the prefix, so that check was a false positive.
+- Keep the H5HL_unprotect NULL checks for heap->prfx and heap->dblk, which are the
+  actual fix for the reported crash (OSS-Fuzz 504827191).
+- Add a regression test (corrupt_heap_unprotect) in test/lheap.c using the
+  minimized fuzzer file heap_corrupt_prfx.h5, asserting the corrupted file fails
+  gracefully instead of crashing in H5HL_unprotect.
+- Document the fix in release_docs/CHANGELOG.md.
+
+* Improve lheap regression test for H5HL_unprotect NULL deref
+
+Replace the file-based traversal (which does not deterministically reach
+the cache-eviction path that nulls heap->prfx) with a white-box check that
+protects a local heap, simulates the corrupted/evicted condition by nulling
+the heap's prfx/dblk pointers, and verifies H5HL_unprotect() returns an
+error instead of dereferencing NULL. Keep a best-effort open/traverse of the
+OSS-Fuzz minimized file (issue 504827191) as a smoke test.
+
+Verified: without the fix the test aborts (H5AC_unpin_entry(NULL)); with the
+fix it passes.
+
+* Improve lheap regression test to consider review comments
+
+* Fix formatting
+
+* test: improve lheap regression test for reviewer comments
+
+- Use H5L_info2_t in visitor (matches H5L_iterate2_t signature)
+- Use H5O_info2_t with H5Oget_info_by_name3
+- Replicate matio's exact traversal: H5Literate2 + H5Gopen2/H5Dopen2 +
+  H5Lvisit2 recursion, H5Aiterate2 attribute reads, skip #refs#/#subsystem#
+- Keep white-box deterministic NULL-pointer guard (fuzzer file does not
+  deterministically crash via public API alone; original crash required
+  matio fuzzer's specific cache-pressure environment)
+- Add CORRUPT_HEAP_TESTFILE define back for white-box test
+
+* Fix formatting
+
+* Reject a local heap unprotect when its pinned cache entry is gone
+
+H5HL_unprotect() now reports an error instead of dereferencing NULL when the
+cache entry that H5HL_protect() pinned is no longer linked to the heap, and it
+checks for that before decrementing the protect count so a rejected call leaves
+the heap unchanged. The regression test as written couldn't fail, since its cleanup
+label was after passed and every failure path still returned 0 (success).
+It also only ever built single-cache-object heaps, and didn't reach the branch the crash
+came from. It now grows a heap into a separate data block to cover both
+branches and uses the standard error reporting.
+
+---------
+
+Co-authored-by: Matthew Larson <[email protected]>
+Co-authored-by: Matt L <[email protected]>
+Co-authored-by: Larry Knox <[email protected]>
+
+CVE: CVE-2026-120758
+Upstream-Status: Backport [https://github.com/HDFGroup/hdf5/commit/91fc37c3325264e67699408e3a190fe4f329bf85]
+
+Dropped changes to the test and CHANGELOG file.
+
+Signed-off-by: Ankur Tyagi <[email protected]>
+---
+ src/H5HL.c | 34 +++++++++++++++++++++-------------
+ 1 file changed, 21 insertions(+), 13 deletions(-)
+
+diff --git a/src/H5HL.c b/src/H5HL.c
+index b55b3690617..838426406a9 100644
+--- a/src/H5HL.c
++++ b/src/H5HL.c
+@@ -416,28 +416,36 @@ H5HL_unprotect(H5HL_t *heap)
+     /* Check arguments */
+     assert(heap);
+ 
+-    /* Decrement # of times heap is protected */
+-    heap->prots--;
+-
+     /* Check for last unprotection of heap */
+-    if (heap->prots == 0) {
+-        /* Check for separate heap data block */
++    if (heap->prots == 1) {
++        void *pin_obj; /* Pointer to local heap object to unpin */
++
++        /* Get the object that H5HL_protect() pinned.  It is unlinked from the
++         * heap when the cache destroys it, which a damaged file can provoke,
++         * so check for it before the protect count is decremented.
++         */
+         if (heap->single_cache_obj) {
+-            /* Mark local heap prefix as evictable again */
+-            if (FAIL == H5AC_unpin_entry(heap->prfx))
+-                HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin local heap data block");
++            if (NULL == heap->prfx)
++                HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "local heap prefix is not in the cache");
++
++            pin_obj = heap->prfx;
+         }
+         else {
+-            /* Sanity check */
+-            assert(heap->dblk);
++            if (NULL == heap->dblk)
++                HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "local heap data block is not in the cache");
+ 
+-            /* Mark local heap data block as evictable again */
+             /* (data block still pins prefix) */
+-            if (FAIL == H5AC_unpin_entry(heap->dblk))
+-                HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin local heap data block");
++            pin_obj = heap->dblk;
+         }
++
++        /* Mark local heap object as evictable again */
++        if (FAIL == H5AC_unpin_entry(pin_obj))
++            HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin local heap object");
+     }
+ 
++    /* Decrement # of times heap is protected */
++    heap->prots--;
++
+ done:
+     FUNC_LEAVE_NOAPI(ret_value)
+ } /* end H5HL_unprotect() */
meta-oe/recipes-support/hdf5/hdf5_2.0.0.bb +1 -0
index 8777345a72..fe3c6211a3 100644
@@ -28,6 +28,7 @@ SRC_URI = "https://support.hdfgroup.org/releases/hdf5/v2_0/v2_0_0/downloads/${BP
            file://CVE-2026-120754-CVE-2026-120755.patch \
            file://CVE-2026-120756.patch \
            file://CVE-2026-120757.patch \
+           file://CVE-2026-120758.patch \
            "
 SRC_URI[sha256sum] = "f4c2edc5668fb846627182708dbe1e16c60c467e63177a75b0b9f12c19d7efed"
 
#7 lore raw

PATCH 8/14 libgphoto2: patch CVE-2026-120451

In reply to [email protected]

From: Ankur Tyagi <[email protected]>

Details:
https://nvd.nist.gov/vuln/detail/cve-2026-120451

---
 .../gphoto2/libgphoto2/CVE-2026-120451.patch  | 43 +++++++++++++++++++
 .../gphoto2/libgphoto2_2.5.33.bb              |  1 +
 2 files changed, 44 insertions(+)
 create mode 100644 meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-120451.patch
meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-120451.patch new file +43 -0
new file mode 100644
index 0000000000..bee9033aac
@@ -0,0 +1,43 @@
+From 021b03a90b744321bb237f66b1052fea58e91224 Mon Sep 17 00:00:00 2001
+From: TheProtagonist07 <[email protected]>
+Date: Wed, 28 Oct 2026 18:51:05 +0530
+Subject: [PATCH] jl2005c: reject an allocation table that does not fit the
+ buffers
+
+jl2005c_init() computes alloc_table_size from the entry count reported by
+the camera and then reads that many bytes into the 0x4020 byte info[] stack
+buffer and copies them into priv->table[0x4000]. For nb_entries >= 1022 both
+operations write past the end of their destination.
+
+Return GP_ERROR_CORRUPTED_DATA if the table would not fit.
+
+Addresses findings 1 and 2 of #1326.
+
+(cherry picked from commit 6a3393dd996502457ab965432cf0b2035278825e)
+
+CVE: CVE-2026-120451
+Upstream-Status: Backport [https://github.com/gphoto/libgphoto2/commit/6a3393dd996502457ab965432cf0b2035278825e]
+Signed-off-by: Ankur Tyagi <[email protected]>
+---
+ camlibs/jl2005c/jl2005c.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/camlibs/jl2005c/jl2005c.c b/camlibs/jl2005c/jl2005c.c
+index c447a23..12c106a 100644
+--- a/camlibs/jl2005c/jl2005c.c
++++ b/camlibs/jl2005c/jl2005c.c
+@@ -144,6 +144,14 @@ restart:
+ 	alloc_table_size = priv->nb_entries * 0x10 + 0x30;
+ 	if (alloc_table_size%0x200)
+ 		alloc_table_size += 0x200 - (alloc_table_size%0x200);
++	/* nb_entries comes from the camera. The table has to fit into the
++	 * local info buffer as well as into priv->table. */
++	if ((size_t)alloc_table_size > sizeof(info) ||
++	    (size_t)alloc_table_size - 0x30 > sizeof(priv->table)) {
++		GP_DEBUG("alloc_table_size 0x%x is too large for %d entries\n",
++			 alloc_table_size, priv->nb_entries);
++		return GP_ERROR_CORRUPTED_DATA;
++	}
+ 	/* However, we have already just now downloaded 0x200 bytes, so
+ 	 * when downloading the rest of the table we correct for that and
+ 	 * just download whatever remains of the information block.
meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb +1 -0
index 04c4786f84..5f1aba6e9c 100644
@@ -21,6 +21,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/gphoto/${BP}.tar.xz;name=libgphoto2 \
            file://CVE-2026-40339.patch \
            file://CVE-2026-40340.patch \
            file://CVE-2026-40341.patch \
+           file://CVE-2026-120451.patch \
            "
 SRC_URI[libgphoto2.sha256sum] = "28825f767a85544cb58f6e15028f8e53a5bb37a62148b3f1708b524781c3bef2"
 
#8 lore raw

PATCH 9/14 libgphoto2: patch CVE-2026-120452

In reply to [email protected]

From: Ankur Tyagi <[email protected]>

Details:
https://nvd.nist.gov/vuln/detail/cve-2026-120452

---
 .../gphoto2/libgphoto2/CVE-2026-120452.patch  | 40 +++++++++++++++++++
 .../gphoto2/libgphoto2_2.5.33.bb              |  1 +
 2 files changed, 41 insertions(+)
 create mode 100644 meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-120452.patch
meta-oe/recipes-graphics/gphoto2/libgphoto2/CVE-2026-120452.patch new file +40 -0
new file mode 100644
index 0000000000..40db2a45bc
@@ -0,0 +1,40 @@
+From 7a074672b3729925ee757eaafab6a30f0f4866e9 Mon Sep 17 00:00:00 2001
+From: TheProtagonist07 <[email protected]>
+Date: Wed, 28 Oct 2026 19:19:32 +0530
+Subject: [PATCH] jl2005c: bound thumbnail conversion by the real input length
+
+jl2005bcd_decompress() picks thumbnail_width/height from a device header
+byte and then byte-swaps that many RGB565 samples starting at input+16.
+When the device claims a 128x120 thumbnail but the input buffer is smaller,
+the loop reads and writes about 30 KB past the heap buffer.
+
+Reject the conversion with GP_ERROR_CORRUPTED_DATA when the input is too
+small. Addresses finding 3 of #1326.
+
+(cherry picked from commit 30bf7ace6d47cfe1232ea73bde2aceb95aba4bfb)
+
+CVE: CVE-2026-120452
+Upstream-Status: Backport [https://github.com/gphoto/libgphoto2/commit/30bf7ace6d47cfe1232ea73bde2aceb95aba4bfb]
+Signed-off-by: Ankur Tyagi <[email protected]>
+---
+ camlibs/jl2005c/jl2005bcd_decompress.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/camlibs/jl2005c/jl2005bcd_decompress.c b/camlibs/jl2005c/jl2005bcd_decompress.c
+index dff2d62..7f06a5a 100644
+--- a/camlibs/jl2005c/jl2005bcd_decompress.c
++++ b/camlibs/jl2005c/jl2005bcd_decompress.c
+@@ -123,6 +123,13 @@ jl2005bcd_decompress (unsigned char *output, unsigned char *input,
+ 			GP_DEBUG("No thumbnail is present!\n");
+ 			return GP_ERROR_NOT_SUPPORTED;
+ 		} else {
++			/* thumbnail_width/height come from a device header byte; the
++			 * RGB565 payload that follows the 16-byte header must actually
++			 * be large enough for that many samples. */
++			if (inputsize < 16 + 2 * thumbnail_width * thumbnail_height) {
++				GP_DEBUG("thumbnail larger than input\n");
++				return GP_ERROR_CORRUPTED_DATA;
++			}
+ 			out = malloc(thumbnail_width * thumbnail_height * 3);
+ 			thumb = (uint16_t *)(input + 16);
+ 			for (i = 0; i < thumbnail_width * thumbnail_height;
meta-oe/recipes-graphics/gphoto2/libgphoto2_2.5.33.bb +1 -0
index 5f1aba6e9c..2b633ec46c 100644
@@ -22,6 +22,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/gphoto/${BP}.tar.xz;name=libgphoto2 \
            file://CVE-2026-40340.patch \
            file://CVE-2026-40341.patch \
            file://CVE-2026-120451.patch \
+           file://CVE-2026-120452.patch \
            "
 SRC_URI[libgphoto2.sha256sum] = "28825f767a85544cb58f6e15028f8e53a5bb37a62148b3f1708b524781c3bef2"
 
#9 lore raw

PATCH 10/14 smarty: upgrade 5.8.4 -> 5.8.5

In reply to [email protected]

From: Ankur Tyagi <[email protected]>

Changelog:
https://github.com/smarty-php/smarty/releases/tag/v5.8.5

(cherry picked from commit 3fe4c2247419cbe376ad010e2e56536bec3faab0)
---
 .../recipes-support/smarty/{smarty_5.8.4.bb => smarty_5.8.5.bb} | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta-oe/recipes-support/smarty/{smarty_5.8.4.bb => smarty_5.8.5.bb} (96%)
meta-oe/recipes-support/smarty/smarty_5.8.5.bb renamed from meta-oe/recipes-support/smarty/smarty_5.8.4.bb +1 -1
similarity index 96%
rename from meta-oe/recipes-support/smarty/smarty_5.8.4.bb
rename to meta-oe/recipes-support/smarty/smarty_5.8.5.bb
index 0c1487f1df..9fabef958e 100644
@@ -12,7 +12,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=2c0f216b2120ffc367e20f2b56df51b3"
 
 SRC_URI = "git://github.com/smarty-php/smarty.git;protocol=https;branch=master;tag=v${PV}"
 
-SRCREV = "94a27cbbc7820198d7adc17a2be8d457fb267753"
+SRCREV = "0ae663525dcbc9e996feb2a867e43bc85f960938"
 
 
 INHIBIT_DEFAULT_DEPS = "1"
#10 lore raw

PATCH 11/14 valkey: upgrade 9.0.6 -> 9.0.7

In reply to [email protected]

From: Ankur Tyagi <[email protected]>

Changelog:
https://github.com/valkey-io/valkey/releases/tag/9.0.7

---
 .../valkey/{valkey_9.0.6.bb => valkey_9.0.7.bb}                 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta-oe/recipes-extended/valkey/{valkey_9.0.6.bb => valkey_9.0.7.bb} (98%)
meta-oe/recipes-extended/valkey/valkey_9.0.7.bb renamed from meta-oe/recipes-extended/valkey/valkey_9.0.6.bb +1 -1
similarity index 98%
rename from meta-oe/recipes-extended/valkey/valkey_9.0.6.bb
rename to meta-oe/recipes-extended/valkey/valkey_9.0.7.bb
index d31a5dbfe5..10a8eec507 100644
@@ -15,7 +15,7 @@ SRC_URI = "git://github.com/valkey-io/valkey.git;branch=9.0;protocol=https;tag=$
            file://0001-src-Do-not-reset-FINAL_LIBS.patch \
            file://GNU_SOURCE-7.patch \
            "
-SRCREV = "a100149d56208209c03f8af9840afe2efa7fb8d1"
+SRCREV = "fe8d406c0b5a64ec897f6455e4de684629883764"
 
 RPROVIDES:${PN} = "virtual-redis"
 
#11 lore raw

PATCH 12/14 uriparser: upgrade 1.0.2 -> 1.0.3

In reply to [email protected]

From: Ankur Tyagi <[email protected]>

Changelog:
https://github.com/uriparser/uriparser/blob/uriparser-1.0.3/ChangeLog

---
 .../uriparser/{uriparser_1.0.2.bb => uriparser_1.0.3.bb}        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta-oe/recipes-support/uriparser/{uriparser_1.0.2.bb => uriparser_1.0.3.bb} (91%)
meta-oe/recipes-support/uriparser/uriparser_1.0.3.bb renamed from meta-oe/recipes-support/uriparser/uriparser_1.0.2.bb +1 -1
similarity index 91%
rename from meta-oe/recipes-support/uriparser/uriparser_1.0.2.bb
rename to meta-oe/recipes-support/uriparser/uriparser_1.0.3.bb
index d4be4b14c8..3eb4635fa3 100644
@@ -10,7 +10,7 @@ LIC_FILES_CHKSUM = "file://src/COPYING;md5=fcc5a53146c2401f4b4f6a3bdf3f0168 \
 
 SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${BP}/${BP}.tar.gz \
            file://run-ptest"
-SRC_URI[sha256sum] = "963554c32d40fb6cba5644f1ba63e6dd7a182b2948bd71ee448c532f53b07f1e"
+SRC_URI[sha256sum] = "b5014a630e61e085787f760c83675a35ef8e719972b05e8f61ff2f48692b15dc"
 
 inherit cmake github-releases ptest
 
#12 lore raw

PATCH 13/14 python3-django: upgrade 6.0.9 -> 6.0.10

In reply to [email protected]

From: Ankur Tyagi <[email protected]>

Changelog:
https://docs.djangoproject.com/en/dev/releases/6.0.10/

---
 .../{python3-django_6.0.9.bb => python3-django_6.0.10.bb}       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta-python/recipes-devtools/python/{python3-django_6.0.9.bb => python3-django_6.0.10.bb} (79%)
meta-python/recipes-devtools/python/python3-django_6.0.10.bb renamed from meta-python/recipes-devtools/python/python3-django_6.0.9.bb +1 -1
similarity index 79%
rename from meta-python/recipes-devtools/python/python3-django_6.0.9.bb
rename to meta-python/recipes-devtools/python/python3-django_6.0.10.bb
index f4e29dc645..46b02a57ef 100644
@@ -1,7 +1,7 @@
 require python3-django.inc
 inherit python_setuptools_build_meta
 
-SRC_URI[sha256sum] = "8ce037c971f421cfb47d38c097ca233a8f6dd42d9e9501a37e02dd7d08c5cb3f"
+SRC_URI[sha256sum] = "6005d030df924f85088454c18bd35dcf082b058aa355ad3df520d8de9aef9f41"
 SRC_URI += "file://0001-Revert-Bumped-minimum-setuptools-version-to-83.patch"
 
 # Set DEFAULT_PREFERENCE so that the LTS version of django is built by
#13 lore raw

PATCH 14/14 python3-django: upgrade 5.2.18 -> 5.2.19

In reply to [email protected]

From: Ankur Tyagi <[email protected]>

Changelog:
https://docs.djangoproject.com/en/dev/releases/5.2.19/

---
 .../{python3-django_5.2.18.bb => python3-django_5.2.19.bb}      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta-python/recipes-devtools/python/{python3-django_5.2.18.bb => python3-django_5.2.19.bb} (70%)
meta-python/recipes-devtools/python/python3-django_5.2.19.bb renamed from meta-python/recipes-devtools/python/python3-django_5.2.18.bb +1 -1
similarity index 70%
rename from meta-python/recipes-devtools/python/python3-django_5.2.18.bb
rename to meta-python/recipes-devtools/python/python3-django_5.2.19.bb
index 4e3d0b431d..46c1cca1fa 100644
@@ -3,4 +3,4 @@ inherit python_setuptools_build_meta
 
 SRC_URI += "file://0001-fix-test_msgfmt_error_including_non_ascii-test.patch \
             file://0001-pyproject-lower-setuptools-requirement.patch"
-SRC_URI[sha256sum] = "461c5dd06d2ea16bd5ca37d3f46e4def1d6b0fe7588c6f4e2119517bb0af8b2d"
+SRC_URI[sha256sum] = "ad03d8abc51dbff95ebf34b27123cf0c26a3b62db7ba0cd520783686362533d1"