From: Samuel Just Date: Fri, 3 Jun 2016 00:36:21 +0000 (-0700) Subject: hobject: compensate for non-canonical hobject_t::get_max() encodings X-Git-Tag: v11.0.0~296^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=42fad4b76def50a0984bf3de06f78ed434d56954;p=ceph.git hobject: compensate for non-canonical hobject_t::get_max() encodings This closes a loop-hole that could allow a non-canonical in memory hobject_t::get_max() object which would return true for is_max(), but false for *this == hobject_t::get_max(). Fixes: http://tracker.ceph.com/issues/16113 Signed-off-by: Samuel Just --- diff --git a/src/common/hobject.cc b/src/common/hobject.cc index 51403d7c1a37..8c3f9a2692da 100644 --- a/src/common/hobject.cc +++ b/src/common/hobject.cc @@ -142,6 +142,12 @@ void hobject_t::decode(bufferlist::iterator& bl) pool = INT64_MIN; assert(is_min()); } + + // for compatibility with some earlier verisons which might encoded + // a non-canonical max object + if (max) { + *this = hobject_t::get_max(); + } } DECODE_FINISH(bl); build_hash_cache();