From: Sage Weil Date: Thu, 7 Jan 2016 17:51:03 +0000 (-0500) Subject: os/FuseStore: do not call exists() on an out-of-bounds oid X-Git-Tag: v10.0.4~154^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b2a1c8614fb5ba2c3fac7782f33f174b9d64c464;p=ceph.git os/FuseStore: do not call exists() on an out-of-bounds oid Signed-off-by: Sage Weil --- diff --git a/src/os/FuseStore.cc b/src/os/FuseStore.cc index 775771f5552d..1f47b4346f16 100644 --- a/src/os/FuseStore.cc +++ b/src/os/FuseStore.cc @@ -210,6 +210,26 @@ static int os_getattr(const char *path, struct stat *stbuf) stbuf->st_gid = 0; stbuf->st_mode = S_IFREG | 0700; + switch (t) { + case FN_OBJECT_OMAP: + case FN_OBJECT_ATTR: + case FN_OBJECT: + case FN_OBJECT_DATA: + case FN_OBJECT_OMAP_HEADER: + case FN_OBJECT_OMAP_VAL: + { + spg_t pgid; + if (cid.is_pg(&pgid)) { + int bits = fs->store->collection_bits(cid); + if (bits >= 0 && !oid.match(bits, pgid.ps())) { + // sorry, not part of this PG + return -ENOENT; + } + } + } + break; + } + switch (t) { case FN_OBJECT_OMAP: case FN_OBJECT_ATTR: