{"id":"CVE-2026-99557","aliases":["CVE-2026-99557"],"related":[],"kind":"vulnerability","state":"published","title":"ceph: fail readdir when the MDS reply carries no dirfrag","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nceph: fail readdir when the MDS reply carries no dirfrag\n\nA ceph mount oopses in ceph_readdir() when the MDS answers a READDIR\nrequest with a reply whose extra blob is empty.  parse_reply_info()\nskips reply blobs whose length is zero, so parse_reply_info_readdir()\nnever runs, r_reply_info.dir_dir stays NULL, and the reply still\nparses as successful.  ceph_mdsc_do_request() returns 0 and\nceph_readdir() then reads rinfo->dir_dir->frag with no NULL check:\n\n\t/* extra */\n\tceph_decode_32_safe(&p, end, len, bad);\n\tif (len > 0) {\n\t\t...\n\t\terr = parse_reply_info_extra(&p, p + len, req, features, s);\n\t\t...\n\t}\n\nThe oops on v7.3.0-rc4-00537-ga3ff15db6820, one getdents64(2) on the\nmount root after an ms_mode=legacy mount, trimmed:\n\nBUG: KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]\nOops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN NOPTI\nCPU: 1 UID: 0 PID: 266 Comm: ls Tainted: G                 N  7.3.0-rc4-00537-ga3ff15db6820 #1 PREEMPT(lazy)\nRIP: 0010:ceph_readdir+0xbff/0x3ea0\nCall Trace:\n <TASK>\n ? __pfx_ceph_readdir+0x10/0x10\n wrap_directory_iterator+0xa2/0xe0\n iterate_dir+0x1da/0x5d0\n __x64_sys_getdents64+0x13b/0x2a0\n do_syscall_64+0xdd/0x4a0\n entry_SYSCALL_64_after_hwframe+0x77/0x7f\n </TASK>\n\nThe unconditional frag read came in with 81c6aea5275ea (\"ceph: handle\nfrag mismatch between readdir request and reply\"), so the bug is old.\n\nTreat a reply with no dirfrag as a protocol violation: warn once,\ndrop the request and return -EIO, the same way ceph_readdir() already\nhandles the two malformed-reply cases later in the function.\n\nTested on v7.3.0-rc4-00537-ga3ff15db6820 (KASAN).  Unpatched, the\ngetdents64(2) above takes the machine down (oops=panic) on the first\nREADDIR reply.  With the patch it warns once and getdents64(2)\nreturns -EIO, no oops, no hang.  A conformant reply for an empty\ndirectory — dirfrag present, zero entries, FRAG_END|FRAG_COMPLETE —\nstill lists \".\" and \"..\" and returns EOF on both kernels, so normal\nreaddir behavior is unchanged.  The oops is still present in\nv7.3-rc5 (72d3fcf802c45).","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nceph: fail readdir when the MDS reply carries no dirfrag\n\nA ceph mount oopses in ceph_readdir() when the MDS answers a READDIR\nrequest with a reply whose extra blob is empty.  parse_reply_info()\nskips reply blobs whose length is zero, so parse_reply_info_readdir()\nnever runs, r_reply_info.dir_dir stays NULL, and the reply still\nparses as successful.  ceph_mdsc_do_request() returns 0 and\nceph_readdir() then reads rinfo->dir_dir->frag with no NULL check:\n\n\t/* extra */\n\tceph_decode_32_safe(&p, end, len, bad);\n\tif (len > 0) {\n\t\t...\n\t\terr = parse_reply_info_extra(&p, p + len, req, features, s);\n\t\t...\n\t}\n\nThe oops on v7.3.0-rc4-00537-ga3ff15db6820, one getdents64(2) on the\nmount root after an ms_mode=legacy mount, trimmed:\n\nBUG: KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]\nOops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN NOPTI\nCPU: 1 UID: 0 PID: 266 Comm: ls Tainted: G                 N  7.3.0-rc4-00537-ga3ff15db6820 #1 PREEMPT(lazy)\nRIP: 0010:ceph_readdir+0xbff/0x3ea0\nCall Trace:\n <TASK>\n ? __pfx_ceph_readdir+0x10/0x10\n wrap_directory_iterator+0xa2/0xe0\n iterate_dir+0x1da/0x5d0\n __x64_sys_getdents64+0x13b/0x2a0\n do_syscall_64+0xdd/0x4a0\n entry_SYSCALL_64_after_hwframe+0x77/0x7f\n </TASK>\n\nThe unconditional frag read came in with 81c6aea5275ea (\"ceph: handle\nfrag mismatch between readdir request and reply\"), so the bug is old.\n\nTreat a reply with no dirfrag as a protocol violation: warn once,\ndrop the request and return -EIO, the same way ceph_readdir() already\nhandles the two malformed-reply cases later in the function.\n\nTested on v7.3.0-rc4-00537-ga3ff15db6820 (KASAN).  Unpatched, the\ngetdents64(2) above takes the machine down (oops=panic) on the first\nREADDIR reply.  With the patch it warns once and getdents64(2)\nreturns -EIO, no oops, no hang.  A conformant reply for an empty\ndirectory — dirfrag present, zero entries, FRAG_END|FRAG_COMPLETE —\nstill lists \".\" and \"..\" and returns EOF on both kernels, so normal\nreaddir behavior is unchanged.  The oops is still present in\nv7.3-rc5 (72d3fcf802c45).","source":"cvelist"}],"published":"2026-11-19T14:45:28.825Z","modified":"2026-11-23T08:17:58.050Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"81c6aea5275eae453719d7f3924da07e668265c5","fixed":"500d7e85af3116803d2cdae9f3a8319e782b84e2","status":"affected"},{"type":"git","introduced":"81c6aea5275eae453719d7f3924da07e668265c5","fixed":"ba0a9ccfd717a603ac10520f723cf4a4881e61b6","status":"affected"},{"type":"git","introduced":"81c6aea5275eae453719d7f3924da07e668265c5","fixed":"12646a00f8549c9f17e5213c30bd608e81fee8f9","status":"affected"},{"type":"git","introduced":"81c6aea5275eae453719d7f3924da07e668265c5","fixed":"4ec54ab76c627e4ff8dc29a18237f923ee1f2bee","status":"affected"},{"type":"git","introduced":"81c6aea5275eae453719d7f3924da07e668265c5","fixed":"37d01a684e6087e264895ab34b829d2267ad607c","status":"affected"},{"type":"git","introduced":"81c6aea5275eae453719d7f3924da07e668265c5","fixed":"49d7c1beac3810983869ed9260dcd444b6a51c8e","status":"affected"},{"type":"git","introduced":"81c6aea5275eae453719d7f3924da07e668265c5","fixed":"d129cfc783b5ff091f5edcccf8129608ec50c000","status":"affected"},{"type":"git","introduced":"81c6aea5275eae453719d7f3924da07e668265c5","fixed":"728c856d7da04fb79f7aa00e974ffb6f55e55995","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"3.13","status":"affected"},{"type":"semver","introduced":"0","fixed":"3.13","status":"unaffected"},{"type":"semver","introduced":"5.10.275","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.226","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.193","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.163","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.117","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.61","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.2","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/500d7e85af3116803d2cdae9f3a8319e782b84e2","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ba0a9ccfd717a603ac10520f723cf4a4881e61b6","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/12646a00f8549c9f17e5213c30bd608e81fee8f9","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/4ec54ab76c627e4ff8dc29a18237f923ee1f2bee","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/37d01a684e6087e264895ab34b829d2267ad607c","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/49d7c1beac3810983869ed9260dcd444b6a51c8e","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d129cfc783b5ff091f5edcccf8129608ec50c000","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/728c856d7da04fb79f7aa00e974ffb6f55e55995","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-99557","url":"https://www.cve.org/CVERecord?id=CVE-2026-99557","licence":"CVE Terms of Use","modified":"2026-11-23T08:04:22.745Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-99557","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99557","licence":"Public domain","modified":"2026-11-23T08:17:58.050Z"}],"updatedAt":"2026-11-25T22:59:52.115Z","epss":{"score":0.00202,"percentile":0.10661,"date":"2026-12-01T12:00:22.000Z"}}