diff --git a/SPECS/hdf5/CVE-2025-2913.patch b/SPECS/hdf5/CVE-2025-2913.patch new file mode 100644 index 00000000000..24bbb5861e8 --- /dev/null +++ b/SPECS/hdf5/CVE-2025-2913.patch @@ -0,0 +1,34 @@ +From 5f977a44cd87b7dd7afa3fb610c84cf0b11fc8d5 Mon Sep 17 00:00:00 2001 +From: Binh-Minh +Date: Mon, 4 Aug 2025 03:10:29 -0400 +Subject: [PATCH] Fix reading bad size in the raw header continuation message + +This issue was reported in GH-5376 as a heap-use-after-free vulnerability in +one of the free lists. It appeared that the library came to this vulnerability +after it encountered an undetected reading of a bad value. The fuzzer now failed +with an appropriate error message. + +This considers addressing what GH-5376 reported. + +Signed-off-by: Azure Linux Security Servicing Account +Upstream-reference: https://github.com/HDFGroup/hdf5/pull/5710.patch +--- + src/H5Ocont.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/H5Ocont.c b/src/H5Ocont.c +index 621095a..c03f4dd 100644 +--- a/src/H5Ocont.c ++++ b/src/H5Ocont.c +@@ -100,6 +100,8 @@ H5O__cont_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSE + if (H5_IS_BUFFER_OVERFLOW(p, H5F_sizeof_size(f), p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); + H5F_DECODE_LENGTH(f, p, cont->size); ++ if (cont->size == 0) ++ HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "invalid continuation chunk size (0)"); + + cont->chunkno = 0; + +-- +2.45.4 + diff --git a/SPECS/hdf5/CVE-2025-2914.patch b/SPECS/hdf5/CVE-2025-2914.patch new file mode 100644 index 00000000000..5b24149a91a --- /dev/null +++ b/SPECS/hdf5/CVE-2025-2914.patch @@ -0,0 +1,48 @@ +From 79bfbd8ab3b2dafdea47c727cad735b22c1144ce Mon Sep 17 00:00:00 2001 +From: Binh-Minh +Date: Tue, 12 Aug 2025 20:06:42 -0400 +Subject: [PATCH] Refix of the attempts in PR-5209 + +This PR addresses the root cause of the issue by adding a sanity-check immediately +after reading the file space page size from the file. + +The same fuzzer in GH-5376 was used to verify that the assert before the vulnerability +had occurred and that an error indicating a corrupted file space page size replaced it. + +Signed-off-by: Azure Linux Security Servicing Account +Upstream-reference: https://github.com/HDFGroup/hdf5/pull/5722.patch +--- + src/H5Fsuper.c | 2 ++ + src/H5Ofsinfo.c | 3 +++ + 2 files changed, 5 insertions(+) + +diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c +index 3e5bc9a..4de4c1f 100644 +--- a/src/H5Fsuper.c ++++ b/src/H5Fsuper.c +@@ -756,6 +756,8 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, bool initial_read) + if (!(flags & H5O_MSG_FLAG_WAS_UNKNOWN)) { + H5O_fsinfo_t fsinfo; /* File space info message from superblock extension */ + ++ memset(&fsinfo, 0, sizeof(H5O_fsinfo_t)); ++ + /* f->shared->null_fsm_addr: Whether to drop free-space to the floor */ + /* The h5clear tool uses this property to tell the library + * to drop free-space to the floor +diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c +index 5b69235..2bb6ea6 100644 +--- a/src/H5Ofsinfo.c ++++ b/src/H5Ofsinfo.c +@@ -182,6 +182,9 @@ H5O__fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNU + if (H5_IS_BUFFER_OVERFLOW(p, H5F_sizeof_size(f), p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); + H5F_DECODE_LENGTH(f, p, fsinfo->page_size); /* File space page size */ ++ /* Basic sanity check */ ++ if (fsinfo->page_size == 0 || fsinfo->page_size > H5F_FILE_SPACE_PAGE_SIZE_MAX) ++ HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "invalid page size in file space info"); + + if (H5_IS_BUFFER_OVERFLOW(p, 2, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); +-- +2.45.4 + diff --git a/SPECS/hdf5/CVE-2025-2924.patch b/SPECS/hdf5/CVE-2025-2924.patch new file mode 100644 index 00000000000..024d359fa8c --- /dev/null +++ b/SPECS/hdf5/CVE-2025-2924.patch @@ -0,0 +1,147 @@ +From abc0b16c2e39652ce297688446f7c380c3c4ee74 Mon Sep 17 00:00:00 2001 +From: Glenn Song +Date: Thu, 11 Sep 2025 16:24:33 -0500 +Subject: [PATCH 1/4] Add to sanity check + +--- + src/H5HLcache.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/H5HLcache.c b/src/H5HLcache.c +index d0836fe..dd66162 100644 +--- a/src/H5HLcache.c ++++ b/src/H5HLcache.c +@@ -232,7 +232,7 @@ H5HL__fl_deserialize(H5HL_t *heap) + const uint8_t *image; /* Pointer into image buffer */ + + /* Sanity check */ +- if ((free_block + (2 * heap->sizeof_size)) > heap->dblk_size) ++ if ((free_block > heap->dblk_size) || ((free_block + (2 * heap->sizeof_size)) > heap->dblk_size)) + HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "bad heap free list"); + + /* Allocate & initialize free list node */ +-- +2.45.4 + + +From 738fe08756f8dd388b883e31ffe93905140360ce Mon Sep 17 00:00:00 2001 +From: Glenn Song +Date: Thu, 11 Sep 2025 18:47:22 -0500 +Subject: [PATCH 2/4] Add better check for overflow + +--- + src/H5HLcache.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/H5HLcache.c b/src/H5HLcache.c +index dd66162..ed27e23 100644 +--- a/src/H5HLcache.c ++++ b/src/H5HLcache.c +@@ -232,7 +232,12 @@ H5HL__fl_deserialize(H5HL_t *heap) + const uint8_t *image; /* Pointer into image buffer */ + + /* Sanity check */ +- if ((free_block > heap->dblk_size) || ((free_block + (2 * heap->sizeof_size)) > heap->dblk_size)) ++ HDcompile_assert(sizeof(hsize_t) == sizeof(uint64_t)); ++ ++ if (free_block > UINT64_MAX - (2 * heap->sizeof_size)) ++ HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "decoded heap block address overflow"); ++ ++ if ((free_block + (2 * heap->sizeof_size)) > heap->dblk_size) + HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "bad heap free list"); + + /* Allocate & initialize free list node */ +-- +2.45.4 + + +From 155a1ffba3e19d11bf4de43deb27f4dac0bb9644 Mon Sep 17 00:00:00 2001 +From: Glenn Song +Date: Thu, 11 Sep 2025 19:22:38 -0500 +Subject: [PATCH 3/4] Add release note + +--- + release_docs/RELEASE.txt | 7 +++++++ + src/H5HLcache.c | 6 +++--- + 2 files changed, 10 insertions(+), 3 deletions(-) + +diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt +index d94ed33..7e76a37 100644 +--- a/release_docs/RELEASE.txt ++++ b/release_docs/RELEASE.txt +@@ -997,6 +997,13 @@ Bug Fixes since HDF5-1.14.3 release + The MPI-2 supporting artifacts have been removed due to the cessation + of MPI-2 maintenance and testing since version HDF5 1.12. + ++ - Check for overflow in decoded heap block addresses ++ ++ Currently, we do not check for overflow when decoding addresses from ++ the heap, which can cause overflow problems. We've added a check in ++ H5HL__fl_deserialize to ensure no overflow can occur. ++ ++ Fixes GitHub issue #5382 + + - Fixed a segfault when using a user-defined conversion function between compound datatypes + +diff --git a/src/H5HLcache.c b/src/H5HLcache.c +index ed27e23..0e684cc 100644 +--- a/src/H5HLcache.c ++++ b/src/H5HLcache.c +@@ -225,15 +225,15 @@ H5HL__fl_deserialize(H5HL_t *heap) + /* check arguments */ + assert(heap); + assert(!heap->freelist); +- ++ HDcompile_assert(sizeof(hsize_t) == sizeof(uint64_t)); ++ + /* Build free list */ + free_block = heap->free_block; + while (H5HL_FREE_NULL != free_block) { + const uint8_t *image; /* Pointer into image buffer */ + + /* Sanity check */ +- HDcompile_assert(sizeof(hsize_t) == sizeof(uint64_t)); +- ++ + if (free_block > UINT64_MAX - (2 * heap->sizeof_size)) + HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "decoded heap block address overflow"); + +-- +2.45.4 + + +From dda4babedbcf26002d88fc5a62123d293f1358a2 Mon Sep 17 00:00:00 2001 +From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> +Date: Fri, 12 Sep 2025 00:24:29 +0000 +Subject: [PATCH 4/4] Committing clang-format changes + +Signed-off-by: Azure Linux Security Servicing Account +Upstream-reference: https://github.com/HDFGroup/hdf5/pull/5814.patch +--- + src/H5HLcache.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/H5HLcache.c b/src/H5HLcache.c +index 0e684cc..7f412d2 100644 +--- a/src/H5HLcache.c ++++ b/src/H5HLcache.c +@@ -226,14 +226,14 @@ H5HL__fl_deserialize(H5HL_t *heap) + assert(heap); + assert(!heap->freelist); + HDcompile_assert(sizeof(hsize_t) == sizeof(uint64_t)); +- ++ + /* Build free list */ + free_block = heap->free_block; + while (H5HL_FREE_NULL != free_block) { + const uint8_t *image; /* Pointer into image buffer */ + + /* Sanity check */ +- ++ + if (free_block > UINT64_MAX - (2 * heap->sizeof_size)) + HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "decoded heap block address overflow"); + +-- +2.45.4 + diff --git a/SPECS/hdf5/CVE-2025-44905.patch b/SPECS/hdf5/CVE-2025-44905.patch new file mode 100644 index 00000000000..95780354014 --- /dev/null +++ b/SPECS/hdf5/CVE-2025-44905.patch @@ -0,0 +1,154 @@ +From f4cd98cfc5a8d9380b4e089326b8340a10b9769f Mon Sep 17 00:00:00 2001 +From: Christian Wojek +Date: Sat, 11 Oct 2025 12:43:06 +0200 +Subject: [PATCH 1/5] Fixing CVE-2025-44905. A malformed HDF5 can cause reading + beyond a heap allocation. + +--- + src/H5Zscaleoffset.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c +index 048344b..ad118f3 100644 +--- a/src/H5Zscaleoffset.c ++++ b/src/H5Zscaleoffset.c +@@ -1205,6 +1205,9 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu + unsigned minval_size = 0; + + minbits = 0; ++ if (*buf_size < 4) ++ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "buffer too short"); ++ + for (i = 0; i < 4; i++) { + minbits_mask = ((unsigned char *)*buf)[i]; + minbits_mask <<= i * 8; +-- +2.45.4 + + +From 186cef3aa5c7c5b0bd70f58a169a11443a7feb1f Mon Sep 17 00:00:00 2001 +From: Christian Wojek +Date: Sat, 11 Oct 2025 16:27:18 +0200 +Subject: [PATCH 2/5] Use H5_IS_BUFFER_OVERFLOW + +--- + src/H5Zscaleoffset.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c +index ad118f3..24b442a 100644 +--- a/src/H5Zscaleoffset.c ++++ b/src/H5Zscaleoffset.c +@@ -1205,7 +1205,7 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu + unsigned minval_size = 0; + + minbits = 0; +- if (*buf_size < 4) ++ if (H5_IS_BUFFER_OVERFLOW(buf, 4, buf + *buf_size - 1)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "buffer too short"); + + for (i = 0; i < 4; i++) { +-- +2.45.4 + + +From c81220cbeeccd711adc384f9c89e20ee4862e866 Mon Sep 17 00:00:00 2001 +From: Christian Wojek +Date: Mon, 27 Oct 2025 22:01:08 +0100 +Subject: [PATCH 3/5] Revised fix after internal review + +--- + src/H5Zscaleoffset.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c +index 24b442a..a397724 100644 +--- a/src/H5Zscaleoffset.c ++++ b/src/H5Zscaleoffset.c +@@ -1205,7 +1205,7 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu + unsigned minval_size = 0; + + minbits = 0; +- if (H5_IS_BUFFER_OVERFLOW(buf, 4, buf + *buf_size - 1)) ++ if (H5_IS_BUFFER_OVERFLOW((unsigned char *)*buf, 5, (unsigned char*)*buf + *buf_size - 1)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "buffer too short"); + + for (i = 0; i < 4; i++) { +@@ -1223,6 +1223,8 @@ 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)) ++ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "buffer too short"); + for (i = 0; i < minval_size; i++) { + minval_mask = ((unsigned char *)*buf)[5 + i]; + minval_mask <<= i * 8; +-- +2.45.4 + + +From 0a82add95ed0f1f8f60b1232f3c0f9ac7de672bb Mon Sep 17 00:00:00 2001 +From: Larry Knox +Date: Tue, 28 Oct 2025 22:27:01 -0500 +Subject: [PATCH 4/5] Apply suggestions from code review + +--- + src/H5Zscaleoffset.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c +index a397724..42a9541 100644 +--- a/src/H5Zscaleoffset.c ++++ b/src/H5Zscaleoffset.c +@@ -1205,7 +1205,7 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu + unsigned minval_size = 0; + + minbits = 0; +- if (H5_IS_BUFFER_OVERFLOW((unsigned char *)*buf, 5, (unsigned char*)*buf + *buf_size - 1)) ++ if (H5_IS_BUFFER_OVERFLOW((unsigned char *)*buf, 5, (unsigned char *)*buf + *buf_size - 1)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "buffer too short"); + + for (i = 0; i < 4; i++) { +@@ -1223,7 +1223,8 @@ 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 + *buf_size - 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]; +-- +2.45.4 + + +From d8c235b9a696578ccd20a0ac23c8c6bedf79b37a Mon Sep 17 00:00:00 2001 +From: Larry Knox +Date: Tue, 28 Oct 2025 22:33:15 -0500 +Subject: [PATCH 5/5] Update src/H5Zscaleoffset.c + +Eliminate extra spaces + +Signed-off-by: Azure Linux Security Servicing Account +Upstream-reference: https://github.com/HDFGroup/hdf5/pull/5915.patch +--- + src/H5Zscaleoffset.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c +index 42a9541..fbf12d6 100644 +--- a/src/H5Zscaleoffset.c ++++ b/src/H5Zscaleoffset.c +@@ -1224,7 +1224,7 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu + : ((unsigned char *)*buf)[4]; + minval = 0; + if (H5_IS_BUFFER_OVERFLOW((unsigned char *)*buf, 5 + minval_size, +- (unsigned char *)*buf + *buf_size - 1)) ++ (unsigned char *)*buf + *buf_size - 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]; +-- +2.45.4 + diff --git a/SPECS/hdf5/CVE-2025-7067.patch b/SPECS/hdf5/CVE-2025-7067.patch new file mode 100644 index 00000000000..fc43a0b01a8 --- /dev/null +++ b/SPECS/hdf5/CVE-2025-7067.patch @@ -0,0 +1,996 @@ +From 3a02f13d0544fdd6c4dd70707dd12d3b0e874f0a Mon Sep 17 00:00:00 2001 +From: Jordan Henderson +Date: Fri, 12 Sep 2025 21:58:17 -0500 +Subject: [PATCH 1/2] Unlink file free space section on failure to update data + structures + +When linking a file free space section into a free space manager's +internal data structures, the library previously wouldn't unlink +the free space section when it failed to update the free space +manager's internal data structures. This could eventually result +in a use-after-free issue due to the stale reference kept around. +--- + src/H5FSsection.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/src/H5FSsection.c b/src/H5FSsection.c +index 57022a2..0882486 100644 +--- a/src/H5FSsection.c ++++ b/src/H5FSsection.c +@@ -1057,8 +1057,9 @@ done: + static herr_t + H5FS__sect_link(H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags) + { +- const H5FS_section_class_t *cls; /* Class of section */ +- herr_t ret_value = SUCCEED; /* Return value */ ++ const H5FS_section_class_t *cls; /* Class of section */ ++ bool linked_sect = false; /* Was the section linked in? */ ++ herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + +@@ -1073,6 +1074,7 @@ H5FS__sect_link(H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags) + /* Add section to size tracked data structures */ + if (H5FS__sect_link_size(fspace->sinfo, cls, sect) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't add section to size tracking data structures"); ++ linked_sect = true; + + /* Update rest of free space manager data structures for section addition */ + if (H5FS__sect_link_rest(fspace, cls, sect, flags) < 0) +@@ -1080,6 +1082,12 @@ H5FS__sect_link(H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags) + "can't add section to non-size tracking data structures"); + + done: ++ if (ret_value < 0) { ++ if (linked_sect && H5FS__sect_unlink_size(fspace->sinfo, cls, sect) < 0) ++ HDONE_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, ++ "can't remove section from size tracking data structures"); ++ } ++ + FUNC_LEAVE_NOAPI(ret_value) + } /* H5FS__sect_link() */ + +-- +2.45.4 + + +From ec3627a06b0ed8aebe645453fc36204645bb4d3d Mon Sep 17 00:00:00 2001 +From: Jordan Henderson +Date: Thu, 23 Oct 2025 10:41:30 -0500 +Subject: [PATCH 2/2] Fix several issues uncovered by CVE-2025-7067 + +Signed-off-by: Azure Linux Security Servicing Account +Upstream-reference: https://github.com/HDFGroup/hdf5/pull/5815.patch https://github.com/HDFGroup/hdf5/pull/5938.patch +--- + src/H5FScache.c | 2 +- + src/H5FSprivate.h | 2 +- + src/H5FSsection.c | 77 ++++++++++++++++++++++++++++++++++++---- + src/H5HFspace.c | 2 +- + src/H5MF.c | 58 ++++++++++++++++++++++-------- + src/H5MFpkg.h | 3 +- + src/H5MFsection.c | 24 +++++++++++-- + test/freespace.c | 90 ++++++++++++++++++++++++++--------------------- + test/mf.c | 32 ++++++++--------- + 9 files changed, 205 insertions(+), 85 deletions(-) + +diff --git a/src/H5FScache.c b/src/H5FScache.c +index 3fa31f0..bbebc34 100644 +--- a/src/H5FScache.c ++++ b/src/H5FScache.c +@@ -1020,7 +1020,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l + + /* Insert section in free space manager, unless requested not to */ + if (!(des_flags & H5FS_DESERIALIZE_NO_ADD)) +- if (H5FS_sect_add(udata->f, fspace, new_sect, H5FS_ADD_DESERIALIZING, udata) < 0) ++ if (H5FS_sect_add(udata->f, fspace, new_sect, H5FS_ADD_DESERIALIZING, udata, NULL) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, NULL, + "can't add section to free space manager"); + } /* end for */ +diff --git a/src/H5FSprivate.h b/src/H5FSprivate.h +index f917a25..954fd9e 100644 +--- a/src/H5FSprivate.h ++++ b/src/H5FSprivate.h +@@ -198,7 +198,7 @@ H5_DLL herr_t H5FS_free(H5F_t *f, H5FS_t *fspace, bool free_file_space); + + /* Free space section routines */ + H5_DLL herr_t H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *node, unsigned flags, +- void *op_data); ++ void *op_data, bool *merged_or_shrunk); + H5_DLL htri_t H5FS_sect_try_merge(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags, + void *op_data); + H5_DLL htri_t H5FS_sect_try_extend(H5F_t *f, H5FS_t *fspace, haddr_t addr, hsize_t size, +diff --git a/src/H5FSsection.c b/src/H5FSsection.c +index 0882486..6d9bca7 100644 +--- a/src/H5FSsection.c ++++ b/src/H5FSsection.c +@@ -1297,7 +1297,8 @@ done: + *------------------------------------------------------------------------- + */ + herr_t +-H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags, void *op_data) ++H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags, void *op_data, ++ bool *merged_or_shrunk) + { + H5FS_section_class_t *cls; /* Section's class */ + bool sinfo_valid = false; /* Whether the section info is valid */ +@@ -1318,6 +1319,9 @@ H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flag + assert(H5_addr_defined(sect->addr)); + assert(sect->size); + ++ if (merged_or_shrunk) ++ *merged_or_shrunk = false; ++ + /* Get a pointer to the section info */ + if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info"); +@@ -1344,9 +1348,12 @@ H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flag + /* (If section has been completely merged or shrunk away, 'sect' will + * be NULL at this point - QAK) + */ +- if (sect) ++ if (sect) { + if (H5FS__sect_link(fspace, sect, flags) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't insert free space section into skip list"); ++ } ++ else if (merged_or_shrunk) ++ *merged_or_shrunk = true; + + #ifdef H5FS_SINFO_DEBUG + fprintf(stderr, "%s: fspace->tot_space = %" PRIuHSIZE "\n", __func__, fspace->tot_space); +@@ -2314,11 +2321,15 @@ done: + herr_t + H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, haddr_t *fs_addr_ptr) + { +- hsize_t hdr_alloc_size; +- hsize_t sinfo_alloc_size; +- haddr_t sect_addr = HADDR_UNDEF; /* address of sinfo */ +- haddr_t eoa = HADDR_UNDEF; /* Initial EOA for the file */ +- herr_t ret_value = SUCCEED; /* Return value */ ++ hsize_t hdr_alloc_size = 0; ++ hsize_t sinfo_alloc_size = 0; ++ haddr_t sect_addr = HADDR_UNDEF; /* address of sinfo */ ++ haddr_t eoa = HADDR_UNDEF; /* Initial EOA for the file */ ++ bool allocated_header = false; /* Whether a free space header was allocated */ ++ bool inserted_header = false; /* Whether a free space header was inserted into the metadata cache */ ++ bool allocated_section = false; /* Whether a free space section was allocated */ ++ bool inserted_section = false; /* Whether a free space section was inserted into the metadata cache */ ++ herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + +@@ -2367,10 +2378,12 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, haddr_t + /* Allocate space for the free space header */ + if (HADDR_UNDEF == (fspace->addr = H5MF_alloc(f, H5FD_MEM_FSPACE_HDR, hdr_alloc_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for free space header"); ++ allocated_header = true; + + /* Cache the new free space header (pinned) */ + if (H5AC_insert_entry(f, H5AC_FSPACE_HDR, fspace->addr, fspace, H5AC__PIN_ENTRY_FLAG) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't add free space header to cache"); ++ inserted_header = true; + + *fs_addr_ptr = fspace->addr; + } +@@ -2396,6 +2409,7 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, haddr_t + /* allocate space for the section info */ + if (HADDR_UNDEF == (sect_addr = H5MF_alloc(f, H5FD_MEM_FSPACE_SINFO, sinfo_alloc_size))) + HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for section info"); ++ allocated_section = true; + + /* update fspace->alloc_sect_size and fspace->sect_addr to reflect + * the allocation +@@ -2437,6 +2451,7 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, haddr_t + */ + if (H5AC_insert_entry(f, H5AC_FSPACE_SINFO, sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't add free space sinfo to cache"); ++ inserted_section = true; + + /* We have changed the sinfo address -- Mark free space header dirty */ + if (H5AC_mark_entry_dirty(fspace) < 0) +@@ -2453,5 +2468,53 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, haddr_t + } /* end if */ + + done: ++ if (ret_value < 0) { ++ /* Remove the free space section that was inserted into the metadata cache, ++ * making sure to free the file space that was allocated for it as well. ++ * Avoid expunging the entry, as the information needs to be kept around ++ * until we finish trying to settle the metadata free space manager(s). ++ */ ++ if (allocated_section && (sect_addr == fspace->sect_addr)) { ++ assert(H5_addr_defined(fspace->sect_addr)); ++ ++ if (H5MF_xfree(f, H5FD_MEM_FSPACE_SINFO, sect_addr, sinfo_alloc_size) < 0) ++ HDONE_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to free free space sections"); ++ fspace->sect_addr = HADDR_UNDEF; ++ } ++ ++ if (inserted_section) { ++ if (H5AC_remove_entry(fspace->sinfo) < 0) ++ HDONE_ERROR(H5E_FSPACE, H5E_CANTEXPUNGE, FAIL, ++ "can't remove file free space section from cache"); ++ } ++ ++ /* Remove the free space header that was inserted into the metadata cache, ++ * making sure to free the file space that was allocated for it as well. ++ * Avoid expunging the entry, as the information needs to be kept around ++ * until we finish trying to settle the metadata free space manager(s). ++ */ ++ if (allocated_header) { ++ assert(H5_addr_defined(fspace->addr)); ++ ++ /* Free file space before removing entry from cache, as freeing the ++ * file space may depend on a valid cache pointer. ++ */ ++ if (H5MF_xfree(f, H5FD_MEM_FSPACE_HDR, fspace->addr, hdr_alloc_size) < 0) ++ HDONE_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to free file free space header"); ++ fspace->addr = HADDR_UNDEF; ++ } ++ ++ if (inserted_header) { ++ if (H5AC_mark_entry_clean(fspace) < 0) ++ HDONE_ERROR(H5E_FSPACE, H5E_CANTMARKCLEAN, FAIL, ++ "can't mark file free space header as clean"); ++ if (H5AC_unpin_entry(fspace) < 0) ++ HDONE_ERROR(H5E_FSPACE, H5E_CANTUNPIN, FAIL, "can't unpin file free space header"); ++ if (H5AC_remove_entry(fspace) < 0) ++ HDONE_ERROR(H5E_FSPACE, H5E_CANTEXPUNGE, FAIL, ++ "can't remove file free space header from cache"); ++ } ++ } ++ + FUNC_LEAVE_NOAPI(ret_value) + } /* H5FS_vfd_alloc_hdr_and_section_info_if_needed() */ +diff --git a/src/H5HFspace.c b/src/H5HFspace.c +index 8c9f0c0..ea1b63f 100644 +--- a/src/H5HFspace.c ++++ b/src/H5HFspace.c +@@ -159,7 +159,7 @@ H5HF__space_add(H5HF_hdr_t *hdr, H5HF_free_section_t *node, unsigned flags) + udata.hdr = hdr; + + /* Add to the free space for the heap */ +- if (H5FS_sect_add(hdr->f, hdr->fspace, (H5FS_section_info_t *)node, flags, &udata) < 0) ++ if (H5FS_sect_add(hdr->f, hdr->fspace, (H5FS_section_info_t *)node, flags, &udata, NULL) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "can't add section to heap free space"); + + done: +diff --git a/src/H5MF.c b/src/H5MF.c +index 2de3e7a..a9c1cf5 100644 +--- a/src/H5MF.c ++++ b/src/H5MF.c +@@ -596,7 +596,8 @@ done: + *------------------------------------------------------------------------- + */ + herr_t +-H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_section_t *node) ++H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_section_t *node, ++ bool *merged_or_shrunk) + { + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ + H5AC_ring_t fsm_ring = H5AC_RING_INV; /* Ring of FSM */ +@@ -631,7 +632,8 @@ H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_sectio + __func__, node->sect_info.addr, node->sect_info.size); + #endif /* H5MF_ALLOC_DEBUG_MORE */ + /* Add the section */ +- if (H5FS_sect_add(f, fspace, (H5FS_section_info_t *)node, H5FS_ADD_RETURNED_SPACE, &udata) < 0) ++ if (H5FS_sect_add(f, fspace, (H5FS_section_info_t *)node, H5FS_ADD_RETURNED_SPACE, &udata, ++ merged_or_shrunk) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, FAIL, "can't re-add section to file free space"); + + done: +@@ -711,8 +713,11 @@ H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, h + #endif /* H5MF_ALLOC_DEBUG_MORE */ + + /* Re-add the section to the free-space manager */ +- if (H5MF__add_sect(f, alloc_type, fspace, node) < 0) ++ if (H5MF__add_sect(f, alloc_type, fspace, node, NULL) < 0) { ++ node->sect_info.addr -= size; ++ node->sect_info.size += size; + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, FAIL, "can't re-add section to file free space"); ++ } + } /* end else */ + } /* end if */ + +@@ -852,9 +857,10 @@ done: + static haddr_t + H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) + { +- H5F_mem_page_t ptype; /* Free-space manager type */ +- H5MF_free_section_t *node = NULL; /* Free space section pointer */ +- haddr_t ret_value = HADDR_UNDEF; /* Return value */ ++ H5F_mem_page_t ptype; /* Free-space manager type */ ++ H5MF_free_section_t *node = NULL; /* Free space section pointer */ ++ bool section_merged_or_shrunk = false; /* Whether free space section was merged or shrunk away */ ++ haddr_t ret_value = HADDR_UNDEF; /* Return value */ + + FUNC_ENTER_PACKAGE + +@@ -900,9 +906,13 @@ H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) + "can't initialize free space section"); + + /* Add the fragment to the large free-space manager */ +- if (H5MF__add_sect(f, alloc_type, f->shared->fs_man[ptype], node) < 0) ++ if (H5MF__add_sect(f, alloc_type, f->shared->fs_man[ptype], node, §ion_merged_or_shrunk) < ++ 0) { ++ if (section_merged_or_shrunk) ++ node = NULL; + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, HADDR_UNDEF, + "can't re-add section to file free space"); ++ } + + node = NULL; + } /* end if */ +@@ -931,9 +941,13 @@ H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "can't initialize free space section"); + + /* Add the remaining space in the page to the manager */ +- if (H5MF__add_sect(f, alloc_type, f->shared->fs_man[ptype], node) < 0) ++ if (H5MF__add_sect(f, alloc_type, f->shared->fs_man[ptype], node, §ion_merged_or_shrunk) < ++ 0) { ++ if (section_merged_or_shrunk) ++ node = NULL; + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, HADDR_UNDEF, + "can't re-add section to file free space"); ++ } + + node = NULL; + +@@ -1154,6 +1168,8 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) + + /* If size of the freed section is larger than threshold, add it to the free space manager */ + if (size >= f->shared->fs_threshold) { ++ bool section_merged_or_shrunk = false; /* Whether free space section was merged or shrunk away */ ++ + assert(f->shared->fs_man[fs_type]); + + #ifdef H5MF_ALLOC_DEBUG_MORE +@@ -1161,8 +1177,12 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) + #endif /* H5MF_ALLOC_DEBUG_MORE */ + + /* Add to the free space for the file */ +- if (H5MF__add_sect(f, alloc_type, f->shared->fs_man[fs_type], node) < 0) ++ if (H5MF__add_sect(f, alloc_type, f->shared->fs_man[fs_type], node, §ion_merged_or_shrunk) < 0) { ++ if (section_merged_or_shrunk) ++ node = NULL; + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, FAIL, "can't add section to file free space"); ++ } ++ + node = NULL; + + #ifdef H5MF_ALLOC_DEBUG_MORE +@@ -1316,7 +1336,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space section"); + + /* Add the fragment to the large-sized free-space manager */ +- if (H5MF__add_sect(f, alloc_type, f->shared->fs_man[fs_type], node) < 0) ++ if (H5MF__add_sect(f, alloc_type, f->shared->fs_man[fs_type], node, NULL) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, FAIL, "can't re-add section to file free space"); + + node = NULL; +@@ -3059,8 +3079,13 @@ H5MF_settle_meta_data_fsm(H5F_t *f, bool *fsm_settled) + assert(sm_fssinfo_fs_type > H5F_MEM_PAGE_DEFAULT); + assert(sm_fssinfo_fs_type < H5F_MEM_PAGE_LARGE_SUPER); + +- assert(!H5_addr_defined(f->shared->fs_addr[sm_fshdr_fs_type])); +- assert(!H5_addr_defined(f->shared->fs_addr[sm_fssinfo_fs_type])); ++ if (H5_addr_defined(f->shared->fs_addr[sm_fshdr_fs_type])) ++ HGOTO_ERROR(H5E_FSPACE, H5E_BADVALUE, FAIL, ++ "small free space header block manager should not have had file space allocated"); ++ if (H5_addr_defined(f->shared->fs_addr[sm_fssinfo_fs_type])) ++ HGOTO_ERROR( ++ H5E_FSPACE, H5E_BADVALUE, FAIL, ++ "small free space serialized section manager should not have had file space allocated"); + + /* Note that in most cases, sm_hdr_fspace will equal sm_sinfo_fspace. */ + sm_hdr_fspace = f->shared->fs_man[sm_fshdr_fs_type]; +@@ -3078,8 +3103,13 @@ H5MF_settle_meta_data_fsm(H5F_t *f, bool *fsm_settled) + assert(lg_fssinfo_fs_type >= H5F_MEM_PAGE_LARGE_SUPER); + assert(lg_fssinfo_fs_type < H5F_MEM_PAGE_NTYPES); + +- assert(!H5_addr_defined(f->shared->fs_addr[lg_fshdr_fs_type])); +- assert(!H5_addr_defined(f->shared->fs_addr[lg_fssinfo_fs_type])); ++ if (H5_addr_defined(f->shared->fs_addr[lg_fshdr_fs_type])) ++ HGOTO_ERROR(H5E_FSPACE, H5E_BADVALUE, FAIL, ++ "large free space header block manager should not have had file space allocated"); ++ if (H5_addr_defined(f->shared->fs_addr[lg_fssinfo_fs_type])) ++ HGOTO_ERROR( ++ H5E_FSPACE, H5E_BADVALUE, FAIL, ++ "large free space serialized section manager should not have had file space allocated"); + + /* Note that in most cases, lg_hdr_fspace will equal lg_sinfo_fspace. */ + lg_hdr_fspace = f->shared->fs_man[lg_fshdr_fs_type]; +diff --git a/src/H5MFpkg.h b/src/H5MFpkg.h +index 32d04d3..e6fd7b8 100644 +--- a/src/H5MFpkg.h ++++ b/src/H5MFpkg.h +@@ -176,7 +176,8 @@ H5_DLLVAR const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1]; + H5_DLL herr_t H5MF__open_fstype(H5F_t *f, H5F_mem_page_t type); + H5_DLL herr_t H5MF__start_fstype(H5F_t *f, H5F_mem_page_t type); + H5_DLL htri_t H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, haddr_t *addr); +-H5_DLL herr_t H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_section_t *node); ++H5_DLL herr_t H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_section_t *node, ++ bool *merged_or_shrunk); + H5_DLL void H5MF__alloc_to_fs_type(H5F_shared_t *f_sh, H5FD_mem_t alloc_type, hsize_t size, + H5F_mem_page_t *fs_type); + +diff --git a/src/H5MFsection.c b/src/H5MFsection.c +index a3b3988..04fcdce 100644 +--- a/src/H5MFsection.c ++++ b/src/H5MFsection.c +@@ -360,7 +360,13 @@ H5MF__sect_simple_can_merge(const H5FS_section_info_t *_sect1, const H5FS_sectio + assert(sect1); + assert(sect2); + assert(sect1->sect_info.type == sect2->sect_info.type); /* Checks "MERGE_SYM" flag */ +- assert(H5_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); ++ ++ /* ++ * The library currently doesn't attempt to detect duplicate or overlapping ++ * free space sections being inserted into the free space managers. Until it ++ * does so, this assertion must be left out. ++ */ ++ /* assert(H5_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); */ + + /* Check if second section adjoins first section */ + ret_value = H5_addr_eq(sect1->sect_info.addr + sect1->sect_info.size, sect2->sect_info.addr); +@@ -663,7 +669,13 @@ H5MF__sect_small_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section + assert(sect1); + assert(sect2); + assert(sect1->sect_info.type == sect2->sect_info.type); /* Checks "MERGE_SYM" flag */ +- assert(H5_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); ++ ++ /* ++ * The library currently doesn't attempt to detect duplicate or overlapping ++ * free space sections being inserted into the free space managers. Until it ++ * does so, this assertion must be left out. ++ */ ++ /* assert(H5_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); */ + + /* Check if second section adjoins first section */ + ret_value = H5_addr_eq(sect1->sect_info.addr + sect1->sect_info.size, sect2->sect_info.addr); +@@ -769,7 +781,13 @@ H5MF__sect_large_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section + assert(sect1); + assert(sect2); + assert(sect1->sect_info.type == sect2->sect_info.type); /* Checks "MERGE_SYM" flag */ +- assert(H5_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); ++ ++ /* ++ * The library currently doesn't attempt to detect duplicate or overlapping ++ * free space sections being inserted into the free space managers. Until it ++ * does so, this assertion must be left out. ++ */ ++ /* assert(H5_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); */ + + ret_value = H5_addr_eq(sect1->sect_info.addr + sect1->sect_info.size, sect2->sect_info.addr); + +diff --git a/test/freespace.c b/test/freespace.c +index b278d2a..0c9be4b 100644 +--- a/test/freespace.c ++++ b/test/freespace.c +@@ -638,7 +638,7 @@ test_fs_sect_add(hid_t fapl) + init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(frspace_state_t)); +@@ -704,7 +704,7 @@ test_fs_sect_add(hid_t fapl) + init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, 0, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, 0, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(frspace_state_t)); +@@ -781,7 +781,8 @@ test_fs_sect_add(hid_t fapl) + init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, &can_shrink, NULL) < ++ 0) + FAIL_STACK_ERROR; + + /* nothing in free-space */ +@@ -851,7 +852,8 @@ test_fs_sect_add(hid_t fapl) + init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, H5FS_ADD_DESERIALIZING, &can_shrink) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, H5FS_ADD_DESERIALIZING, &can_shrink, NULL) < ++ 0) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(frspace_state_t)); +@@ -1007,7 +1009,7 @@ test_fs_sect_find(hid_t fapl) + init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(frspace_state_t)); +@@ -1027,7 +1029,7 @@ test_fs_sect_find(hid_t fapl) + init_sect_node(sect_node3, (haddr_t)(TEST_SECT_ADDR200), (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + state.tot_space += sect_node3->sect_info.size; +@@ -1046,7 +1048,7 @@ test_fs_sect_find(hid_t fapl) + init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + state.tot_space += sect_node2->sect_info.size; +@@ -1065,7 +1067,7 @@ test_fs_sect_find(hid_t fapl) + init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR300, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node4, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node4, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + state.tot_space += sect_node4->sect_info.size; +@@ -1134,7 +1136,7 @@ test_fs_sect_find(hid_t fapl) + init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(frspace_state_t)); +@@ -1154,7 +1156,7 @@ test_fs_sect_find(hid_t fapl) + init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + state.tot_space += sect_node2->sect_info.size; +@@ -1213,7 +1215,7 @@ test_fs_sect_find(hid_t fapl) + init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(frspace_state_t)); +@@ -1361,7 +1363,7 @@ test_fs_sect_merge(hid_t fapl) + init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(frspace_state_t)); +@@ -1381,7 +1383,7 @@ test_fs_sect_merge(hid_t fapl) + init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + /* section B & C are merged */ +@@ -1399,7 +1401,7 @@ test_fs_sect_merge(hid_t fapl) + init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + /* section A is merged with the merged section of B & C */ +@@ -1417,7 +1419,7 @@ test_fs_sect_merge(hid_t fapl) + init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node4, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node4, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + /* section D is merged with the merged section of A & B & C */ +@@ -1490,7 +1492,7 @@ test_fs_sect_merge(hid_t fapl) + init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(frspace_state_t)); +@@ -1510,7 +1512,7 @@ test_fs_sect_merge(hid_t fapl) + init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + /* section A & B are not merged because H5FS_CLS_SEPAR_OBJ is set */ +@@ -1593,7 +1595,7 @@ test_fs_sect_merge(hid_t fapl) + init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(frspace_state_t)); +@@ -1613,7 +1615,7 @@ test_fs_sect_merge(hid_t fapl) + init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, + TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + /* sections A & B are not merged because H5FS_CLS_MERGE_SYM is set & section class type is different */ +@@ -1633,7 +1635,7 @@ test_fs_sect_merge(hid_t fapl) + init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, + TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + /* sections B & C are merged because H5FS_CLS_MERGE_SYM is set & section class type is the same */ +@@ -1651,7 +1653,7 @@ test_fs_sect_merge(hid_t fapl) + init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node4, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node4, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + /* +@@ -1840,7 +1842,8 @@ test_fs_sect_shrink(hid_t fapl) + TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE); + + can_shrink = false; +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink, ++ NULL) < 0) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(frspace_state_t)); +@@ -1875,7 +1878,8 @@ test_fs_sect_shrink(hid_t fapl) + H5FS_SECT_LIVE); + + can_shrink = false; +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink, ++ NULL) < 0) + FAIL_STACK_ERROR; + + /* should have nothing in free-space */ +@@ -1941,7 +1945,8 @@ test_fs_sect_shrink(hid_t fapl) + init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink, ++ NULL) < 0) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(frspace_state_t)); +@@ -1961,7 +1966,8 @@ test_fs_sect_shrink(hid_t fapl) + init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, &can_shrink, ++ NULL) < 0) + FAIL_STACK_ERROR; + + /* free-space should be the same since section B is shrunk */ +@@ -2041,7 +2047,8 @@ test_fs_sect_shrink(hid_t fapl) + init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink, ++ NULL) < 0) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(frspace_state_t)); +@@ -2061,7 +2068,8 @@ test_fs_sect_shrink(hid_t fapl) + init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, &can_shrink, ++ NULL) < 0) + FAIL_STACK_ERROR; + + /* section A & B are merged and then strunk, so there is nothing in free-space */ +@@ -2183,7 +2191,7 @@ test_fs_sect_change_class(hid_t fapl) + init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(frspace_state_t)); +@@ -2203,7 +2211,7 @@ test_fs_sect_change_class(hid_t fapl) + init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, + TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + state.tot_space += TEST_SECT_SIZE50; +@@ -2287,7 +2295,7 @@ test_fs_sect_change_class(hid_t fapl) + init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + /* +@@ -2299,7 +2307,7 @@ test_fs_sect_change_class(hid_t fapl) + init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, + TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + /* +@@ -2311,7 +2319,7 @@ test_fs_sect_change_class(hid_t fapl) + init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, + TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + /* change the class of B to A's class */ +@@ -2471,7 +2479,7 @@ test_fs_sect_extend(hid_t fapl) + init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(frspace_state_t)); +@@ -2491,7 +2499,7 @@ test_fs_sect_extend(hid_t fapl) + init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + state.tot_space += sect_node2->sect_info.size; +@@ -2548,7 +2556,7 @@ test_fs_sect_extend(hid_t fapl) + init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(frspace_state_t)); +@@ -2568,7 +2576,7 @@ test_fs_sect_extend(hid_t fapl) + init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + state.tot_space += sect_node2->sect_info.size; +@@ -2622,7 +2630,7 @@ test_fs_sect_extend(hid_t fapl) + init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(frspace_state_t)); +@@ -2642,7 +2650,7 @@ test_fs_sect_extend(hid_t fapl) + init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + state.tot_space += sect_node2->sect_info.size; +@@ -2697,7 +2705,7 @@ test_fs_sect_extend(hid_t fapl) + init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(frspace_state_t)); +@@ -2717,7 +2725,7 @@ test_fs_sect_extend(hid_t fapl) + init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, + H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + + state.tot_space += sect_node2->sect_info.size; +@@ -2828,7 +2836,7 @@ test_fs_sect_iterate(hid_t fapl) + sect_size = (unsigned)((i - 1) % 9) + 1; + init_sect_node(sect_node, (haddr_t)i * 10, (hsize_t)sect_size, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); + +- if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, NULL) < 0) ++ if (H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, NULL, NULL) < 0) + FAIL_STACK_ERROR; + } /* end for */ + +diff --git a/test/mf.c b/test/mf.c +index 909a7ec..8058d14 100644 +--- a/test/mf.c ++++ b/test/mf.c +@@ -1222,7 +1222,7 @@ test_mf_fs_alloc_free(hid_t fapl) + sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); + + /* Add section A to free-space manager */ +- if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) ++ if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node, NULL)) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(H5FS_stat_t)); +@@ -1300,7 +1300,7 @@ test_mf_fs_alloc_free(hid_t fapl) + sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); + + /* Add section A to free-space manager */ +- if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) ++ if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node, NULL)) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(H5FS_stat_t)); +@@ -1376,7 +1376,7 @@ test_mf_fs_alloc_free(hid_t fapl) + sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); + + /* Add section A to free-space manager */ +- if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) ++ if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node, NULL)) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(H5FS_stat_t)); +@@ -1552,7 +1552,7 @@ test_mf_fs_extend(hid_t fapl) + sect_node1 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); + + /* Add section A to free-space manager */ +- if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) ++ if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1, NULL)) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(H5FS_stat_t)); +@@ -1581,7 +1581,7 @@ test_mf_fs_extend(hid_t fapl) + sect_node2 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); + + /* Add section B to free-space manager */ +- if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) ++ if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2, NULL)) + FAIL_STACK_ERROR; + + state.tot_space += TBLOCK_SIZE50; +@@ -1662,7 +1662,7 @@ test_mf_fs_extend(hid_t fapl) + sect_node1 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); + + /* Add section A to free-space manager */ +- if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) ++ if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1, NULL)) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(H5FS_stat_t)); +@@ -1691,7 +1691,7 @@ test_mf_fs_extend(hid_t fapl) + sect_node2 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); + + /* Add section B to free-space manager */ +- if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) ++ if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2, NULL)) + FAIL_STACK_ERROR; + + state.tot_space += TBLOCK_SIZE50; +@@ -1767,7 +1767,7 @@ test_mf_fs_extend(hid_t fapl) + sect_node1 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); + + /* Add section A to free-space manager */ +- if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) ++ if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1, NULL)) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(H5FS_stat_t)); +@@ -1796,7 +1796,7 @@ test_mf_fs_extend(hid_t fapl) + sect_node2 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); + + /* Add section B to free-space manager */ +- if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) ++ if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2, NULL)) + FAIL_STACK_ERROR; + + state.tot_space += TBLOCK_SIZE50; +@@ -1873,7 +1873,7 @@ test_mf_fs_extend(hid_t fapl) + H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)(TBLOCK_SIZE30 - 10)); + + /* Add section A of size=20 to free-space */ +- if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) ++ if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1, NULL)) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(H5FS_stat_t)); +@@ -1902,7 +1902,7 @@ test_mf_fs_extend(hid_t fapl) + sect_node2 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); + + /* Add section B to free-space manager */ +- if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) ++ if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2, NULL)) + FAIL_STACK_ERROR; + + state.tot_space += TBLOCK_SIZE50; +@@ -2057,7 +2057,7 @@ test_mf_fs_absorb(const char *driver_name, hid_t fapl) + H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)(ma_addr + ma_size), (hsize_t)TBLOCK_SIZE2048); + + /* Add a section to free-space that adjoins end of the aggregator */ +- if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) ++ if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node, NULL)) + FAIL_STACK_ERROR; + + /* Verify that the section did absorb the aggregator */ +@@ -2117,7 +2117,7 @@ test_mf_fs_absorb(const char *driver_name, hid_t fapl) + sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)addr, (hsize_t)TBLOCK_SIZE30); + + /* When adding, meta_aggr is absorbed onto the end of the section */ +- if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) ++ if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node, NULL)) + FAIL_STACK_ERROR; + + /* Verify that the section did absorb the aggregator */ +@@ -4183,7 +4183,7 @@ test_mf_align_fs(const char *driver_name, hid_t fapl, hid_t new_fapl) + sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)alignment, (hsize_t)TBLOCK_SIZE50); + + /* Add section A to free-space manager */ +- if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) ++ if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node, NULL)) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(H5FS_stat_t)); +@@ -4247,7 +4247,7 @@ test_mf_align_fs(const char *driver_name, hid_t fapl, hid_t new_fapl) + sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE8000); + + /* Add section A to free-space manager */ +- if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) ++ if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node, NULL)) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(H5FS_stat_t)); +@@ -4334,7 +4334,7 @@ test_mf_align_fs(const char *driver_name, hid_t fapl, hid_t new_fapl) + sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE700); + + /* Add section A to free-space manager */ +- if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) ++ if (H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node, NULL)) + FAIL_STACK_ERROR; + + memset(&state, 0, sizeof(H5FS_stat_t)); +-- +2.45.4 + diff --git a/SPECS/hdf5/hdf5.spec b/SPECS/hdf5/hdf5.spec index 1d66ea9d277..cf505eae19b 100644 --- a/SPECS/hdf5/hdf5.spec +++ b/SPECS/hdf5/hdf5.spec @@ -12,7 +12,7 @@ Summary: A general purpose library and file format for storing scientific data Name: hdf5 Version: 1.14.4.3 -Release: 1%{?dist} +Release: 2%{?dist} License: BSD Vendor: Microsoft Corporation Distribution: Azure Linux @@ -24,6 +24,11 @@ Patch3: hdf5-build.patch # Remove Fedora build flags from h5cc/h5c++/h5fc # https://bugzilla.redhat.com/show_bug.cgi?id=1794625 Patch5: hdf5-wrappers.patch +Patch6: CVE-2025-2913.patch +Patch7: CVE-2025-2914.patch +Patch8: CVE-2025-2924.patch +Patch9: CVE-2025-44905.patch +Patch10: CVE-2025-7067.patch # For patches/rpath # For patches/rpath @@ -398,6 +403,9 @@ done %changelog +* Thu Nov 13 2025 Azure Linux Security Servicing Account - 1.14.4.3-2 +- Patch for CVE-2025-7067, CVE-2025-44905, CVE-2025-2924, CVE-2025-2914, CVE-2025-2913 + * Tue Jun 04 2024 Neha Agarwal - 1.14.4.3-1 - Upgrade to v1.14.4.3 to fix CVEs 2024-29157, 2024-29158, 2024-29159, 2024-29160, 2024-29161, 2024-29162, 2024-29163, 2024-29164, 2024-29165, 2024-29166, 2024-32605,