{"api_version":"1","generated_at":"2026-12-06T23:32:04+00:00","cve":"CVE-2026-143261","urls":{"html":"https://cve.report/CVE-2026-143261","api":"https://cve.report/api/cve/CVE-2026-143261.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-143261","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-143261"},"summary":{"title":"libfs: walk offset directories in offset order","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nlibfs: walk offset directories in offset order\n\noffset_iterate_dir() walks d_children from the head and only uses the\nmaple tree to map ctx->pos back to a dentry when a getdents64() call\nresumes. offset_dir_lookup() finds the entry at ctx->pos, or the one\nwith the next lower offset if it is gone, and the list walk continues\nfrom there.\n\nThat only works if list order and offset order agree and quite often\nthey don't. A rename over an existing name gives the moved dentry the\noffset of the name it replaced but __d_move() puts it at the head of\nd_children. RENAME_EXCHANGE does the same to both dentries. And once\nthe cyclic offset allocator wraps new entries get low offsets at the\nhead of the list.\n\nSo if the entry at ctx->pos is unlinked between two getdents64() calls\nwe resume at the entry with the next lower offset and that one can sit\nanywhere in the list:\n\n(1) If it sits further down the list everything in between is skipped.\n    Create y, t, a, b and rename b over t. The list is now t(4) a(5)\n    y(3). Stop the listing at t and unlink t. The next call resumes at\n    y and a is never returned although nobody touched it.\n\n(2) If there is no lower entry we restart at the head and return the\n    whole directory again. Nickolai reported this for the simple case\n    of unlinking the oldest entry while a listing is about to reach it.\n    Ending the walk there instead turns this into (1): create a, b, c,\n    rename c over a, stop the listing at the renamed entry, unlink it,\n    and b is lost.\n\nInstead of the list let's walk the maple tree itself in descending\noffset order. Then ctx->pos really means that everything above it has\nbeen emitted and resuming at the highest offset at or below it is right\nno matter where the dentry sits in d_children. Entries created or\nrenamed to a new name after the listing started get an offset above\nctx->pos and aren't returned, same as with the list walk which never\nwent back to the head. So a readdir loop that renames or creates an\nentry for each one it reads still terminates.\n\nThe maple tree can't change under us as all modifications happen with\nthe directory's i_rwsem held exclusive and offset_readdir() holds it\nshared. That also covers the dentries in the tree. They are all\npersistent and only unlink, rmdir and rename remove or rename them. And\nsince the previous patch i_rwsem is the lock of the tree. So keep a\nsingle ma_state across the walk and emit directly from the dentry\nwithout taking rcu_read_lock(), a reference or d_lock.\n\nThis also makes the walk cheaper than the list walk was. With a million\nentries on tmpfs a getdents64() listing goes from 146ms to 114ms. With\nfour processes listing the directory at the same time it goes from\n470ms to 113ms per listing as they don't bounce the parent's d_lock and\nthe dentries' lockrefs between them anymore.\n\n                                                base     v2       this\n      1M entries, getdents64 32k buffer (ms)    146      127      114\n      1M entries, getdents64 1k buffer (ms)     184      156      141\n      1M entries, getdents64 128b buffer (ms)   429      364      335\n      1M entries, ls -f (s)                     0.259    0.239    0.228\n      1M entries, LC_ALL=C ls (s)               0.482    0.467    0.455\n      1M entries, 4 parallel listers (ms)       470      125      113\n      18 entries, rewind and list (ns)          4107     3594     3323\n      250k of 1M left, getdents64 32k (ms)      58.8     57.8     53.8\n      250k of 1M left, getdents64 128b (ms)     128      114      108","state":"PUBLISHED","assigner":"Linux","published_at":"2026-12-03 10:18:07","updated_at":"2026-12-03 10:18:07"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/8f9c57090ef86832fc754602755e4467554d600f","name":"https://git.kernel.org/stable/c/8f9c57090ef86832fc754602755e4467554d600f","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/309f7a5585aeaf77d3d7c27304ac97e515447dac","name":"https://git.kernel.org/stable/c/309f7a5585aeaf77d3d7c27304ac97e515447dac","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-143261","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-143261","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected b9b588f22a0c049a14885399e27625635ae6ef91 8f9c57090ef86832fc754602755e4467554d600f git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected b9b588f22a0c049a14885399e27625635ae6ef91 309f7a5585aeaf77d3d7c27304ac97e515447dac git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 850e696f362729a163fb6af21a54cde565b71f75 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 639b40424d17d9eb1d826d047ab871fe37897e76 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected d9da7a68a24518e93686d7ae48937187a80944ea git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 176d0333aae43bd0b6d116b1ff4b91e9a15f88ef git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 180c7e44a18bbd7db89dfd7e7b58d920c44db0ca git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 6.6.75 6.7 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 6.12.12 6.13 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 6.13.1 6.14 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 6.12.21 6.13 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 6.13.9 6.14 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 6.14","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.14 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3.7 7.3.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.4-rc3 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":{"cve_year":"2026","cve_id":"143261","cve":"CVE-2026-143261","epss":"0.001980000","percentile":"0.099520000","score_date":"2026-12-03","updated_at":"2026-12-04 00:14:18"},"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["fs/libfs.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"8f9c57090ef86832fc754602755e4467554d600f","status":"affected","version":"b9b588f22a0c049a14885399e27625635ae6ef91","versionType":"git"},{"lessThan":"309f7a5585aeaf77d3d7c27304ac97e515447dac","status":"affected","version":"b9b588f22a0c049a14885399e27625635ae6ef91","versionType":"git"},{"status":"affected","version":"850e696f362729a163fb6af21a54cde565b71f75","versionType":"git"},{"status":"affected","version":"639b40424d17d9eb1d826d047ab871fe37897e76","versionType":"git"},{"status":"affected","version":"d9da7a68a24518e93686d7ae48937187a80944ea","versionType":"git"},{"status":"affected","version":"176d0333aae43bd0b6d116b1ff4b91e9a15f88ef","versionType":"git"},{"status":"affected","version":"180c7e44a18bbd7db89dfd7e7b58d920c44db0ca","versionType":"git"},{"lessThan":"6.7","status":"affected","version":"6.6.75","versionType":"semver"},{"lessThan":"6.13","status":"affected","version":"6.12.12","versionType":"semver"},{"lessThan":"6.14","status":"affected","version":"6.13.1","versionType":"semver"},{"lessThan":"6.13","status":"affected","version":"6.12.21","versionType":"semver"},{"lessThan":"6.14","status":"affected","version":"6.13.9","versionType":"semver"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["fs/libfs.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"6.14"},{"lessThan":"6.14","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"7.3.*","status":"unaffected","version":"7.3.7","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.4-rc3","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.7","versionStartIncluding":"6.14","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc3","versionStartIncluding":"6.14","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6.75","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12.12","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.13.1","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12.21","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.13.9","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nlibfs: walk offset directories in offset order\n\noffset_iterate_dir() walks d_children from the head and only uses the\nmaple tree to map ctx->pos back to a dentry when a getdents64() call\nresumes. offset_dir_lookup() finds the entry at ctx->pos, or the one\nwith the next lower offset if it is gone, and the list walk continues\nfrom there.\n\nThat only works if list order and offset order agree and quite often\nthey don't. A rename over an existing name gives the moved dentry the\noffset of the name it replaced but __d_move() puts it at the head of\nd_children. RENAME_EXCHANGE does the same to both dentries. And once\nthe cyclic offset allocator wraps new entries get low offsets at the\nhead of the list.\n\nSo if the entry at ctx->pos is unlinked between two getdents64() calls\nwe resume at the entry with the next lower offset and that one can sit\nanywhere in the list:\n\n(1) If it sits further down the list everything in between is skipped.\n    Create y, t, a, b and rename b over t. The list is now t(4) a(5)\n    y(3). Stop the listing at t and unlink t. The next call resumes at\n    y and a is never returned although nobody touched it.\n\n(2) If there is no lower entry we restart at the head and return the\n    whole directory again. Nickolai reported this for the simple case\n    of unlinking the oldest entry while a listing is about to reach it.\n    Ending the walk there instead turns this into (1): create a, b, c,\n    rename c over a, stop the listing at the renamed entry, unlink it,\n    and b is lost.\n\nInstead of the list let's walk the maple tree itself in descending\noffset order. Then ctx->pos really means that everything above it has\nbeen emitted and resuming at the highest offset at or below it is right\nno matter where the dentry sits in d_children. Entries created or\nrenamed to a new name after the listing started get an offset above\nctx->pos and aren't returned, same as with the list walk which never\nwent back to the head. So a readdir loop that renames or creates an\nentry for each one it reads still terminates.\n\nThe maple tree can't change under us as all modifications happen with\nthe directory's i_rwsem held exclusive and offset_readdir() holds it\nshared. That also covers the dentries in the tree. They are all\npersistent and only unlink, rmdir and rename remove or rename them. And\nsince the previous patch i_rwsem is the lock of the tree. So keep a\nsingle ma_state across the walk and emit directly from the dentry\nwithout taking rcu_read_lock(), a reference or d_lock.\n\nThis also makes the walk cheaper than the list walk was. With a million\nentries on tmpfs a getdents64() listing goes from 146ms to 114ms. With\nfour processes listing the directory at the same time it goes from\n470ms to 113ms per listing as they don't bounce the parent's d_lock and\nthe dentries' lockrefs between them anymore.\n\n                                                base     v2       this\n      1M entries, getdents64 32k buffer (ms)    146      127      114\n      1M entries, getdents64 1k buffer (ms)     184      156      141\n      1M entries, getdents64 128b buffer (ms)   429      364      335\n      1M entries, ls -f (s)                     0.259    0.239    0.228\n      1M entries, LC_ALL=C ls (s)               0.482    0.467    0.455\n      1M entries, 4 parallel listers (ms)       470      125      113\n      18 entries, rewind and list (ns)          4107     3594     3323\n      250k of 1M left, getdents64 32k (ms)      58.8     57.8     53.8\n      250k of 1M left, getdents64 128b (ms)     128      114      108"}],"providerMetadata":{"dateUpdated":"2026-12-03T09:21:06.649Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/8f9c57090ef86832fc754602755e4467554d600f"},{"url":"https://git.kernel.org/stable/c/309f7a5585aeaf77d3d7c27304ac97e515447dac"}],"title":"libfs: walk offset directories in offset order","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-143261","datePublished":"2026-12-03T09:21:06.649Z","dateReserved":"2026-12-03T03:10:28.363Z","dateUpdated":"2026-12-03T09:21:06.649Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-12-03 10:18:07","lastModifiedDate":"2026-12-03 10:18:07","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"143261","Ordinal":"1","Title":"libfs: walk offset directories in offset order","CVE":"CVE-2026-143261","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"143261","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nlibfs: walk offset directories in offset order\n\noffset_iterate_dir() walks d_children from the head and only uses the\nmaple tree to map ctx->pos back to a dentry when a getdents64() call\nresumes. offset_dir_lookup() finds the entry at ctx->pos, or the one\nwith the next lower offset if it is gone, and the list walk continues\nfrom there.\n\nThat only works if list order and offset order agree and quite often\nthey don't. A rename over an existing name gives the moved dentry the\noffset of the name it replaced but __d_move() puts it at the head of\nd_children. RENAME_EXCHANGE does the same to both dentries. And once\nthe cyclic offset allocator wraps new entries get low offsets at the\nhead of the list.\n\nSo if the entry at ctx->pos is unlinked between two getdents64() calls\nwe resume at the entry with the next lower offset and that one can sit\nanywhere in the list:\n\n(1) If it sits further down the list everything in between is skipped.\n    Create y, t, a, b and rename b over t. The list is now t(4) a(5)\n    y(3). Stop the listing at t and unlink t. The next call resumes at\n    y and a is never returned although nobody touched it.\n\n(2) If there is no lower entry we restart at the head and return the\n    whole directory again. Nickolai reported this for the simple case\n    of unlinking the oldest entry while a listing is about to reach it.\n    Ending the walk there instead turns this into (1): create a, b, c,\n    rename c over a, stop the listing at the renamed entry, unlink it,\n    and b is lost.\n\nInstead of the list let's walk the maple tree itself in descending\noffset order. Then ctx->pos really means that everything above it has\nbeen emitted and resuming at the highest offset at or below it is right\nno matter where the dentry sits in d_children. Entries created or\nrenamed to a new name after the listing started get an offset above\nctx->pos and aren't returned, same as with the list walk which never\nwent back to the head. So a readdir loop that renames or creates an\nentry for each one it reads still terminates.\n\nThe maple tree can't change under us as all modifications happen with\nthe directory's i_rwsem held exclusive and offset_readdir() holds it\nshared. That also covers the dentries in the tree. They are all\npersistent and only unlink, rmdir and rename remove or rename them. And\nsince the previous patch i_rwsem is the lock of the tree. So keep a\nsingle ma_state across the walk and emit directly from the dentry\nwithout taking rcu_read_lock(), a reference or d_lock.\n\nThis also makes the walk cheaper than the list walk was. With a million\nentries on tmpfs a getdents64() listing goes from 146ms to 114ms. With\nfour processes listing the directory at the same time it goes from\n470ms to 113ms per listing as they don't bounce the parent's d_lock and\nthe dentries' lockrefs between them anymore.\n\n                                                base     v2       this\n      1M entries, getdents64 32k buffer (ms)    146      127      114\n      1M entries, getdents64 1k buffer (ms)     184      156      141\n      1M entries, getdents64 128b buffer (ms)   429      364      335\n      1M entries, ls -f (s)                     0.259    0.239    0.228\n      1M entries, LC_ALL=C ls (s)               0.482    0.467    0.455\n      1M entries, 4 parallel listers (ms)       470      125      113\n      18 entries, rewind and list (ns)          4107     3594     3323\n      250k of 1M left, getdents64 32k (ms)      58.8     57.8     53.8\n      250k of 1M left, getdents64 128b (ms)     128      114      108","Type":"Description","Title":"libfs: walk offset directories in offset order"}]}}}