Commit Graph

22340 Commits

Author SHA1 Message Date
Mark Kittisopikul
b9244a85d9
Align arg types of H5D_chunk_iter_op_t with H5Dget_chunk_info (#2074)
* Align arg types of H5D_chunk_iter_op_t with H5Dget_chunk_info

* Modify chunk_info test to for unsigned / hsize_t types

* Fix types in test
2022-12-19 15:13:43 -08:00
Scot Breitenfeld
70cf2c390b
Removed idioms and misc. text clean-up (#2320)
* removed idioms and misc. text clean-up, Issue #2135

* removed idioms and misc. text clean-up, Issue #2135
2022-12-16 19:56:52 -08:00
Allen Byrne
149b8e9769
Disable hl tools by default (#2313)
* Disable hl tools by default

* identify the tools

* Only GIF tools are depecated

* Add new option

* Update autotools
2022-12-16 19:56:07 -08:00
Scot Breitenfeld
8102fa8c97
Only document Fortran functions (#2319)
* Only document Fortran functions

* Only document Fortran functions

* Only document Fortran functions

* Only document Fortran functions
2022-12-16 19:52:08 -08:00
Scot Breitenfeld
784061b15e
moved onion VFD to FAPL group (#2321) 2022-12-16 19:51:52 -08:00
vchoi-hdfgroup
6b6bcdead6
Hdffv 11052 (#2315)
* Fix for HDFFV-11052: h5debug fails on a corrupted file (h5_nrefs_POC) producing a core dump.
When h5debug closes the corrupted file, the library calls H5F__dest() which performs all the
closing operations for the file "f" (H5F_t *) but just keeping note of errors in "ret_value"
all the way till the end of the routine.  The user-provided corrupted file has an illegal
file size causing failure when reading the image during the closing process.
At the end of this routine it sets f->shared to NULL and then frees "f".
This is done whether there is error or not in "ret_value".
Due to the failure in reading the file earlier, the routine then returns error.
The error return from H5F__dest() causes the file object "f" not being removed from the
ID node table.  When the library finally exits, it will try to close the
file objects in the table.  This causes assert failure when H5F_ID_EXISTS(f) or H5F_NREFS(f).
Fix:
a) H5F_dest(): free the f only when there is no error in "ret_value" at the end of the routine.
b) H5VL__native_file_close(): if f->shared is NULL, free "f"; otherwise, perform closing on "f" as before.
c) h5debug.c main(): track error return from H5Fclose().

* Committing clang-format changes

* Add test and release note info for fix to HDFFV-11052 which is merged via PR#2291.

* Committing clang-format changes

* Add the test file to Cmake.

* Skip test_misc37() for drivers that is not default compatible as it is using a pre-generated file.

* Committing clang-format changes

Co-authored-by: vchoi <vchoi@jelly.ad.hdfgroup.org>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-16 13:47:29 -08:00
Dana Robinson
0e76abaf64
Removes duplicated build mode from -Werror GitHub actions (#2314) 2022-12-16 12:05:01 -08:00
Dana Robinson
4bbda3038a
Converts the YAML build mode arrays to objects in special runs (#2308)
* Converts the YAML build mode arrays to objects in special runs

* Adds a dump of the matrix context for each test

This would have made it a LOT easier to debug the build_mode issues...

* Disable the mirror VFD in the -Werror checks

We can re-enable this after we fix the warnings, but I don't want to
conflate code and GitHub changes, so this is a better way to get the
CI to pass for now.
2022-12-15 23:03:02 -08:00
Gerd Heber
138daa8846
Merge pull request #2304 from gheber/develop
Update hdf5_header.html
2022-12-15 13:25:18 -06:00
Gerd Heber
10c693a04f
Update hdf5_header.html
Use less awkward language.
2022-12-15 08:49:19 -06:00
vchoi-hdfgroup
0cb5808087
Hdffv 11052 (#2303)
* Fix for HDFFV-11052: h5debug fails on a corrupted file (h5_nrefs_POC) producing a core dump.
When h5debug closes the corrupted file, the library calls H5F__dest() which performs all the
closing operations for the file "f" (H5F_t *) but just keeping note of errors in "ret_value"
all the way till the end of the routine.  The user-provided corrupted file has an illegal
file size causing failure when reading the image during the closing process.
At the end of this routine it sets f->shared to NULL and then frees "f".
This is done whether there is error or not in "ret_value".
Due to the failure in reading the file earlier, the routine then returns error.
The error return from H5F__dest() causes the file object "f" not being removed from the
ID node table.  When the library finally exits, it will try to close the
file objects in the table.  This causes assert failure when H5F_ID_EXISTS(f) or H5F_NREFS(f).
Fix:
a) H5F_dest(): free the f only when there is no error in "ret_value" at the end of the routine.
b) H5VL__native_file_close(): if f->shared is NULL, free "f"; otherwise, perform closing on "f" as before.
c) h5debug.c main(): track error return from H5Fclose().

* Committing clang-format changes

* Add test and release note info for fix to HDFFV-11052 which is merged via PR#2291.

* Committing clang-format changes

* Add the test file to Cmake.

Co-authored-by: vchoi <vchoi@jelly.ad.hdfgroup.org>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-15 05:32:23 -08:00
Dana Robinson
1b06e868fd
Fixes broken CI matrix actions involving -Werror and API versions (#2302) 2022-12-14 18:05:15 -06:00
Dana Robinson
93938b3a8d
Adds 'unused' hints for MDS io_info parameters (#2301)
* Adds 'unused' hints for MDS io_info parameters

* Committing clang-format changes

* Fix issue with formatter

* Committing clang-format changes

* Final fix for formatter

* Committing clang-format changes

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-14 14:54:51 -08:00
Scot Breitenfeld
a1c81eda20
added doc. warning for H5Literate_async return value (#2295) 2022-12-14 15:22:37 -06:00
Allen Byrne
b7511c19d0
Update windows worker compilers (#2286)
* Update windows worker compilers

* Update bin and test issues

* Update script and revert java test
2022-12-14 08:58:20 -06:00
Scot Breitenfeld
502b32b0f2
Updated H5ES documenation (#2293) 2022-12-13 10:56:48 -08:00
vchoi-hdfgroup
a9036005c3
Fix for HDFFV-11052: h5debug fails on a corrupted file (h5_nrefs_POC)… (#2291)
* Fix for HDFFV-11052: h5debug fails on a corrupted file (h5_nrefs_POC) producing a core dump.
When h5debug closes the corrupted file, the library calls H5F__dest() which performs all the
closing operations for the file "f" (H5F_t *) but just keeping note of errors in "ret_value"
all the way till the end of the routine.  The user-provided corrupted file has an illegal
file size causing failure when reading the image during the closing process.
At the end of this routine it sets f->shared to NULL and then frees "f".
This is done whether there is error or not in "ret_value".
Due to the failure in reading the file earlier, the routine then returns error.
The error return from H5F__dest() causes the file object "f" not being removed from the
ID node table.  When the library finally exits, it will try to close the
file objects in the table.  This causes assert failure when H5F_ID_EXISTS(f) or H5F_NREFS(f).
Fix:
a) H5F_dest(): free the f only when there is no error in "ret_value" at the end of the routine.
b) H5VL__native_file_close(): if f->shared is NULL, free "f"; otherwise, perform closing on "f" as before.
c) h5debug.c main(): track error return from H5Fclose().

* Committing clang-format changes

Co-authored-by: vchoi <vchoi@jelly.ad.hdfgroup.org>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-13 09:40:59 -08:00
Scot Breitenfeld
b9f4c001ad
added doc. warning for H5Oflush in parallel (#2289) 2022-12-09 21:31:13 -06:00
Scot Breitenfeld
4a8be219e0
fixed unclosed objects in test (#2290) 2022-12-09 21:30:42 -06:00
Neil Fortner
ef4f1f2bd4
Check for size==0 for all datatypes read from disk, not just compound (#2287)
members
2022-12-08 10:30:29 -06:00
Egbert Eich
0b4e9cf976
Compound datatypes may not have members of size 0 (#2243)
* Compound datatypes may not have members of size 0

A member size of 0 may lead to an FPE later on as reported in
CVE-2021-46244. To avoid this, check for this as soon as the
member is decoded.
This should probably be done in H5O_dtype_decode_helper() already,
however it is not clear whether all sizes are expected to be != 0.

This fixes CVE-2021-46244 / Bug #2242.

Signed-off-by: Egbert Eich <eich@suse.com>

* Rework error recovery code in H5O__dtype_decode_helper() and
H5O__dtype_decode().

* Format changes for src/H5Odtype.c.

Signed-off-by: Egbert Eich <eich@suse.com>
Co-authored-by: Neil Fortner <nfortne2@hdfgroup.org>
Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
2022-12-07 16:14:40 -06:00
Allen Byrne
dcccc35526
Correct requires setting for pkgconfig files (#2280)
* Correct requires setting for pkgconfig files

* Add issue number
2022-12-07 16:05:51 -06:00
Dana Robinson
64514392fb
Fixes warnings in H5Opline.c error messages (#2281)
* Fixes warnings in H5Opline.c error messages

* Committing clang-format changes

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-06 11:32:39 -08:00
Allen Byrne
0a2006d9c6
Add text about release notes (#2246) 2022-12-06 06:02:21 -08:00
Allen Byrne
2376723d4a
Develop jni trans (#2266)
* Add compound and refactor out atomic types

* Add Array String tests back

* Convert Attribute version of compound example

* Update transfer atom8ic read to return object
2022-12-05 22:29:42 -06:00
V. Armando Solé
281984b3e3
H5E_ERR_CLS_g symbol missing when compiling C++ plugins (#2269)
C++ HDF5 filter plugin SZ3 fails to build under windows with failure at linking time unless that extern "C" block is added.
2022-12-05 19:19:53 -06:00
Scot Breitenfeld
c1c131260a
return error message related to calling API (#2276) 2022-12-02 14:24:43 -06:00
Egbert Eich
24700e8f06
CVE 2021 46242 develop (#2255)
* When evicting driver info block, NULL the corresponding entry

Since H5C_expunge_entry() called (from H5AC_expunge_entry()) sets the  flag
H5C__FLUSH_INVALIDATE_FLAG, the driver info block will be freed. NULLing the
pointer in  f->shared->drvinfo will prevent use-after-free  when it is used in other
functions (like  H5F__dest()) - as other places will check whether the pointer is
initialized before using its value.

This fixes CVE-2021-46242 / Bug #2254

Signed-off-by: Egbert Eich <eich@suse.com>

* When evicting the superblock, NULL the corresponding entry

The call to H5AC_expunge_entry() will free the corresonding structure,
to avoid a use-after-free, the corrsponding pointer entry will be NULLed.

Signed-off-by: Egbert Eich <eich@suse.com>

Signed-off-by: Egbert Eich <eich@suse.com>
2022-12-02 14:24:14 -06:00
Allen Byrne
88b24c258b
Output should only be printed if verbose. (#2273)
* Output should only be printed if verbose.

* Add note
2022-12-02 09:39:49 -08:00
Egbert Eich
4e0277c35a
Report error if dimensions of chunked storage in data layout < 2 (#2241)
For Data Layout Messages version 1 & 2 the specification state
that the value stored in the data field is 1 greater than the
number of dimensions in the dataspace. For version 3 this is
not explicitly stated but the implementation suggests it to be
the case.
Thus the set value needs to be at least 2. For dimensionality
< 2 an out-of-bounds access occurs as in CVE-2021-45833.

This fixes CVE-2021-45833 / Bug #2240.

Signed-off-by: Egbert Eich <eich@suse.com>

Signed-off-by: Egbert Eich <eich@suse.com>
Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
2022-12-01 23:04:42 -06:00
Allen Byrne
96a4e10102
Add aarch64 toolchain and change dump test to long opt (#2271) 2022-12-01 14:32:34 -08:00
Larry Knox
cf232a757f
Develop fix ubuntu 22.04 openmpi install on github (#2268)
* Update install openmpi-bin to also install mpi-default-dev instead of
libopenmpi-dev.  This according to
https://bugs.launchpad.net/ubuntu/+source/openmpi/+bug/1870780.
2022-11-28 13:20:24 -06:00
Egbert Eich
158dff6b50
Make sure testsuite can handle multiple dependent scripts (#2256)
Commit afc54d75a1 to the test suite to eliminate a separate
shell script did not take into account that there may be
multiple dependent test scripts which resulted in the
message:
`/bin/sh: line 7: [: too many arguments`.
when running the test suite.

Beware that this new version still makes use of non-posix GNU
extensions to `test`.

Signed-off-by: Egbert Eich <eich@suse.com>

Signed-off-by: Egbert Eich <eich@suse.com>
2022-11-28 13:19:31 -06:00
Larry Knox
eac2cd54e2
Develop ubuntu 20.04 (#2267)
* Use ubuntu-20.04 for github autotools  parallel tests until parallel
configure is fixed on  ubuntu 22.04.

* Remove inactive developers from CODEOWNERS.

* Temporarily cat config.log for autotools build in github actions.

* Try ubuntu-latest.

* Attempt to cat config.log even when configure fails.

* Fix syntax.

* Try again

* Try again

* Try again.

* Back to original temporary fix.

* Install libopenmpi-dev with openmpi-bin, which was installed as a
dependency prior to ubuntu-22.04.
2022-11-23 12:00:00 -08:00
Larry Knox
3e762b07aa
Use ubuntu-20.04 for github autotools parallel tests until parallel (#2264)
* Use ubuntu-20.04 for github autotools  parallel tests until parallel
configure is fixed on  ubuntu 22.04.
2022-11-18 17:30:29 -06:00
raylu-hdf
ee4d92e01b
Bug Fix: Segfault in H5CX_get_vol_wrap_ctx when H5VLwrap_register is called from an application (#2248)
* Jira HDFFV-10881: Segfault in H5CX_get_vol_wrap_ctx when H5VLwrap_register is called from an application.  A quick and simple fix to make it fail with a relevant error message.

* Format changes.

* Committing clang-format changes

* Minor change: split one condition check into two for clarity.

* Adding doxygen comment for H5VLwrap_register.

* Minor change: adding a little more detail to the Doxygen comment for H5VLwrap_register.
2022-11-17 16:29:21 -06:00
Ryan Schmidt
9dd36f016a
Simplify & fix check for szlib encoder (#2263)
Return the result rather than setting the exit code. "return" is a
language keyword whereas "exit" is a function for which the <stdlib.h>
header has to be included which it wasn't in this test, therefore the
test would previously fail to identify that the encoder was enabled if
"-Werror=implicit-function-declaration" was used, which it is by default
with clang from Xcode 12 and later.

Fixes #2262
2022-11-17 16:28:44 -06:00
Allen Byrne
169896aedb
Remove hard-coded version text (#2260)
* Remove hard-coded version text

* Use macOS 11 until accum test is fixed see #2261
2022-11-16 15:13:46 -06:00
Allen Byrne
719d800499
Refactor JNI translate functions to a recursive switch on datatype (#2232) 2022-11-15 22:44:33 -06:00
Scot Breitenfeld
03cc221016
moved quad precision checks (#2252)
* Only check quad sizes if fortran is enabled

* fixed if struct
2022-11-12 12:53:35 -06:00
Egbert Eich
0f94940f1a
H5O_dtype_decode_helper: Parent of enum needs to have same size as enum itself (#2237)
The size of the enumeration values is determined by the size of the parent.
Functions accessing the enumeration values use the size of the enumeration
to determine the size of each element and how much data to copy. Thus the
size of the enumeration and its parent need to match.
Check here to avoid unpleasant surprises later.

This fixes CVE-2018-14031 / Bug #2236.

Signed-off-by: Egbert Eich <eich@suse.com>
2022-11-11 00:05:00 -06:00
Egbert Eich
34ec3bb7bc
Make sure info block for external links has at least 3 bytes (#2234)
According to the specification, the information block for external links
contains 1 byte of version/flag information and two 0 terminated strings
for the object linked to and the full path.
Although not very useful, the minimum string length for each (with
terminating 0) would be one byte.
Checking this will help to avoid SEGVs triggered by bogus files.

This fixes CVE-2018-16438 / Bug #2233.

Signed-off-by: Egbert Eich <eich@suse.com>
2022-11-10 23:41:53 -06:00
Egbert Eich
1750b4b0af
Validate location (offset) of the accumulated metadata when comparing (#2231)
Initially, the accumulated metadata location is initialized to HADDR_UNDEF
- the highest available address. Bogus input files may provide a location
or size matching this value. Comparing this address against such bogus
values may provide false positives. This make sure, the value has been
initilized or fail the comparison early and let other parts of the
code deal with the bogus address/size.
Note: To avoid unnecessary checks, we have assumed that if the 'dirty'
member in the same structure is true the location is valid.

This fixes CVE-2018-13867 / Bug #2230.

Signed-off-by: Egbert Eich <eich@suse.com>
2022-11-10 23:24:56 -06:00
Egbert Eich
659bc99fd1
Make H5O__fsinfo_decode() more resilient to out-of-bound reads. (#2229)
When decoding a file space info message in H5O__fsinfo_decode() make
sure each element to be decoded is still within the message. Malformed
hdf5 files may have trunkated content which does not match the
expected size. Checking this will prevent attempting to decode
unrelated data and heap overflows. So far, only free space manager
address data was checked before decoding.

This fixes CVE-2021-45830 / Bug #2228.

Signed-off-by: Egbert Eich <eich@suse.com>

Additions

Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
2022-11-10 23:20:09 -06:00
Egbert Eich
99487d9e45
H5IMget_image_info(): Make sure to not exceed local array size (#2227)
Malformed hdf5 files may provide more dimensions than the array dim[] in
H5IMget_image_info() is able to hold. Check number of elements first by calling
H5Sget_simple_extent_dims() with NULL for both 'dims' and 'maxdims' arguments.
This will cause the function to return only the number of dimensions.
The fix addresse a stack overflow on write.

This fixes CVE-2018-17439 / HDFFV-10589 / Bug #2226.

Signed-off-by: Egbert Eich <eich@suse.com>

Signed-off-by: Egbert Eich <eich@suse.com>
2022-11-10 23:01:45 -06:00
Scot Breitenfeld
5985d0e0b1
removed uninterpretable line (#2249) 2022-11-10 22:56:53 -06:00
Dana Robinson
a8942c7413
Adds a release note for PR #2210 (CVE-2019-8396) (#2247)
* Adds a release note for PR #2210 (CVE-2019-8396)

* Capitalization issue fixed
2022-11-09 17:03:55 -08:00
Dana Robinson
d93c6fae43
Removes MPE instrumentation support. (#2245)
* Removes MPE instrumentation support.

The Autotools will no longer accept --with-mpe= and the logging commands
have been removed from the FUNC_ENTER macros. CMake has never supported
instrumenting for MPE.

* Committing clang-format changes

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-09 11:06:26 -08:00
Egbert Eich
18c438bdf0
H5O__pline_decode() Make more resilient to out-of-bounds read (#2210)
Malformed hdf5 files may have trunkated content which does not match
the expected size. When this function attempts to decode these it may
read past the end of the allocated space leading to heap overflows
as bounds checking is incomplete.
Make sure each element is within bounds before reading.

This fixes CVE-2019-8396 / HDFFV-10712 / github bug #2209.

Signed-off-by: Egbert Eich <eich@suse.com>

Signed-off-by: Egbert Eich <eich@suse.com>
2022-11-09 10:25:11 -08:00
Dana Robinson
adc467992e
Moved the contributing.md document to the project root (#2244) 2022-11-09 09:58:32 -08:00