]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: skip the buffer in UnknownPayload::decode() 40427/head
authorXiubo Li <xiubli@redhat.com>
Fri, 26 Mar 2021 07:57:47 +0000 (15:57 +0800)
committerXiubo Li <xiubli@redhat.com>
Fri, 26 Mar 2021 08:13:36 +0000 (16:13 +0800)
If it receiving an unknown type of metric, it should skip the buffer
when dropping it. Or it will cause corruption.

Fixes: https://tracker.ceph.com/issues/49972
Signed-off-by: Xiubo Li <xiubli@redhat.com>
src/include/cephfs/metrics/Types.h

index 3f2b642fdb3d54e9c16d736339796a20355b9958..5843a1ed0fb737e861e5ead9b8ff794452472f5b 100644 (file)
@@ -367,6 +367,10 @@ struct UnknownPayload {
   }
 
   void decode(bufferlist::const_iterator &iter) {
+    using ceph::decode;
+    DECODE_START(254, iter);
+    iter.seek(struct_len);
+    DECODE_FINISH(iter);
   }
 
   void dump(Formatter *f) const {