1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
commit bfae878d8f2f65bc5f22f0d4bb314f326278ba7b
Author: Neil Fortner <nfortne2@hdfgroup.org>
Date: Fri Jul 1 10:31:44 2016 -0500
[svn-r30131] Fix bug reported by Cisco Talos TALOS-CAN-0178. Added check for a message that
should not be sharable being marked as sharable on disk, returns failure in
this case. Needs testing.
Tested: ummon
Index: hdf5/src/H5Ocache.c
===================================================================
--- hdf5.orig/src/H5Ocache.c
+++ hdf5/src/H5Ocache.c
@@ -1433,6 +1433,10 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "bad flag combination for message")
if((flags & H5O_MSG_FLAG_WAS_UNKNOWN) && !(flags & H5O_MSG_FLAG_MARK_IF_UNKNOWN))
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "bad flag combination for message")
+ if((flags & H5O_MSG_FLAG_SHAREABLE)
+ && H5O_msg_class_g[id]
+ && !(H5O_msg_class_g[id]->share_flags & H5O_SHARE_IS_SHARABLE))
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "message of unsharable class flagged as sharable")
/* Reserved bytes/creation index */
if(oh->version == H5O_VERSION_1)
Index: hdf5/src/H5Opkg.h
===================================================================
--- hdf5.orig/src/H5Opkg.h
+++ hdf5/src/H5Opkg.h
@@ -212,6 +212,7 @@
\
/* Set the message's "shared info", if it's shareable */ \
if((MSG)->flags & H5O_MSG_FLAG_SHAREABLE) { \
+ HDassert(msg_type->share_flags & H5O_SHARE_IS_SHARABLE); \
H5O_UPDATE_SHARED((H5O_shared_t *)(MSG)->native, H5O_SHARE_TYPE_HERE, (F), msg_type->id, (MSG)->crt_idx, (OH)->chunk[0].addr) \
} /* end if */ \
\
|