{"id":"CVE-2024-39469","state":"PUBLISHED","title":"nilfs2: fix nilfs_empty_dir() misjudgment and long loop on I/O errors","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnilfs2: fix nilfs_empty_dir() misjudgment and long loop on I/O errors\n\nThe error handling in nilfs_empty_dir() when a directory folio/page read\nfails is incorrect, as in the old ext2 implementation, and if the\nfolio/page cannot be read or nilfs_check_folio() fails, it will falsely\ndetermine the directory as empty and corrupt the file system.\n\nIn addition, since nilfs_empty_dir() does not immediately return on a\nfailed folio/page read, but continues to loop, this can cause a long loop\nwith I/O if i_size of the directory's inode is also corrupted, causing the\nlog writer thread to wait and hang, as reported by syzbot.\n\nFix these issues by making nilfs_empty_dir() immediately return a false\nvalue (0) if it fails to get a directory folio/page.","publishedAt":"2024-06-25T14:28:55.581Z","updatedAt":"2026-10-15T00:44:10.229Z","severity":{"score":7.1,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"2ba466d74ed74f073257f86e61519cb8f8f46184","status":"affected","lessThan":"2ac8a2fe22bdde9eecce2a42cf5cab79333fb428","versionType":"git"},{"version":"2ba466d74ed74f073257f86e61519cb8f8f46184","status":"affected","lessThan":"405b71f1251e5ae865f53bd27c45114e6c83bee3","versionType":"git"},{"version":"2ba466d74ed74f073257f86e61519cb8f8f46184","status":"affected","lessThan":"c77ad608df6c091fe64ecb91f41ef7cb465587f1","versionType":"git"},{"version":"2ba466d74ed74f073257f86e61519cb8f8f46184","status":"affected","lessThan":"11a2edb70356a2202dcb7c9c189c8356ab4752cd","versionType":"git"},{"version":"2ba466d74ed74f073257f86e61519cb8f8f46184","status":"affected","lessThan":"129dcd3e7d036218db3f59c82d82004b9539ed82","versionType":"git"},{"version":"2ba466d74ed74f073257f86e61519cb8f8f46184","status":"affected","lessThan":"d18b05eda7fa77f02114f15b02c009f28ee42346","versionType":"git"},{"version":"2ba466d74ed74f073257f86e61519cb8f8f46184","status":"affected","lessThan":"59f14875a96ef93f05b82ad3c980605f2cb444b5","versionType":"git"},{"version":"2ba466d74ed74f073257f86e61519cb8f8f46184","status":"affected","lessThan":"7373a51e7998b508af7136530f3a997b286ce81c","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nilfs2/dir.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.30","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.30","versionType":"semver"},{"version":"4.19.317","status":"unaffected","lessThanOrEqual":"4.19.*","versionType":"semver"},{"version":"5.4.279","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.221","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.162","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.95","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.35","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.9.5","status":"unaffected","lessThanOrEqual":"6.9.*","versionType":"semver"},{"version":"6.10","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nilfs2/dir.c"]}],"references":["https://git.kernel.org/stable/c/2ac8a2fe22bdde9eecce2a42cf5cab79333fb428","https://git.kernel.org/stable/c/405b71f1251e5ae865f53bd27c45114e6c83bee3","https://git.kernel.org/stable/c/c77ad608df6c091fe64ecb91f41ef7cb465587f1","https://git.kernel.org/stable/c/11a2edb70356a2202dcb7c9c189c8356ab4752cd","https://git.kernel.org/stable/c/129dcd3e7d036218db3f59c82d82004b9539ed82","https://git.kernel.org/stable/c/d18b05eda7fa77f02114f15b02c009f28ee42346","https://git.kernel.org/stable/c/59f14875a96ef93f05b82ad3c980605f2cb444b5","https://git.kernel.org/stable/c/7373a51e7998b508af7136530f3a997b286ce81c","https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html","https://cert-portal.siemens.com/productcert/html/ssa-398330.html","https://cert-portal.siemens.com/productcert/html/ssa-355557.html"],"weaknesses":[],"ingestedAt":"2026-10-29T20:07:39.287Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/39xxx/CVE-2024-39469.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-39469","state":"PUBLISHED","datePublished":"2024-06-25T14:28:55.581Z","dateUpdated":"2026-10-15T00:44:10.229Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-06-25T14:23:23.745Z"},"containers":{"cna":{"title":"nilfs2: fix nilfs_empty_dir() misjudgment and long loop on I/O errors","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnilfs2: fix nilfs_empty_dir() misjudgment and long loop on I/O errors\n\nThe error handling in nilfs_empty_dir() when a directory folio/page read\nfails is incorrect, as in the old ext2 implementation, and if the\nfolio/page cannot be read or nilfs_check_folio() fails, it will falsely\ndetermine the directory as empty and corrupt the file system.\n\nIn addition, since nilfs_empty_dir() does not immediately return on a\nfailed folio/page read, but continues to loop, this can cause a long loop\nwith I/O if i_size of the directory's inode is also corrupted, causing the\nlog writer thread to wait and hang, as reported by syzbot.\n\nFix these issues by making nilfs_empty_dir() immediately return a false\nvalue (0) if it fails to get a directory folio/page."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"2ba466d74ed74f073257f86e61519cb8f8f46184","status":"affected","lessThan":"2ac8a2fe22bdde9eecce2a42cf5cab79333fb428","versionType":"git"},{"version":"2ba466d74ed74f073257f86e61519cb8f8f46184","status":"affected","lessThan":"405b71f1251e5ae865f53bd27c45114e6c83bee3","versionType":"git"},{"version":"2ba466d74ed74f073257f86e61519cb8f8f46184","status":"affected","lessThan":"c77ad608df6c091fe64ecb91f41ef7cb465587f1","versionType":"git"},{"version":"2ba466d74ed74f073257f86e61519cb8f8f46184","status":"affected","lessThan":"11a2edb70356a2202dcb7c9c189c8356ab4752cd","versionType":"git"},{"version":"2ba466d74ed74f073257f86e61519cb8f8f46184","status":"affected","lessThan":"129dcd3e7d036218db3f59c82d82004b9539ed82","versionType":"git"},{"version":"2ba466d74ed74f073257f86e61519cb8f8f46184","status":"affected","lessThan":"d18b05eda7fa77f02114f15b02c009f28ee42346","versionType":"git"},{"version":"2ba466d74ed74f073257f86e61519cb8f8f46184","status":"affected","lessThan":"59f14875a96ef93f05b82ad3c980605f2cb444b5","versionType":"git"},{"version":"2ba466d74ed74f073257f86e61519cb8f8f46184","status":"affected","lessThan":"7373a51e7998b508af7136530f3a997b286ce81c","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nilfs2/dir.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.30","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.30","versionType":"semver"},{"version":"4.19.317","status":"unaffected","lessThanOrEqual":"4.19.*","versionType":"semver"},{"version":"5.4.279","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.221","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.162","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.95","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.35","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.9.5","status":"unaffected","lessThanOrEqual":"6.9.*","versionType":"semver"},{"version":"6.10","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nilfs2/dir.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/2ac8a2fe22bdde9eecce2a42cf5cab79333fb428"},{"url":"https://git.kernel.org/stable/c/405b71f1251e5ae865f53bd27c45114e6c83bee3"},{"url":"https://git.kernel.org/stable/c/c77ad608df6c091fe64ecb91f41ef7cb465587f1"},{"url":"https://git.kernel.org/stable/c/11a2edb70356a2202dcb7c9c189c8356ab4752cd"},{"url":"https://git.kernel.org/stable/c/129dcd3e7d036218db3f59c82d82004b9539ed82"},{"url":"https://git.kernel.org/stable/c/d18b05eda7fa77f02114f15b02c009f28ee42346"},{"url":"https://git.kernel.org/stable/c/59f14875a96ef93f05b82ad3c980605f2cb444b5"},{"url":"https://git.kernel.org/stable/c/7373a51e7998b508af7136530f3a997b286ce81c"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","baseScore":7.1,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The vulnerable code is reached through the local `rmdir(2)`/`rename(2)` syscall path on a mounted nilfs2 filesystem, with the malicious directory state supplied by a crafted nilfs2 image (automounted removable media, loop-mounted file, or admin-mounted volume). No network protocol handler is involved in the vulnerable function itself.\nAC:L - The attacker fully controls the on-disk directory: setting a corrupt `rec_len`/alignment/inode number so `nilfs_check_folio()` deterministically fails, and setting a huge `i_size` (read unvalidated at `inode.c:412`) so `dir_pages()` yields ~2^51 iterations. Both the false \"empty\" verdict and the segctor-sem hang follow deterministically with no race, timing window, or memory-layout dependency.\nPR:L - Once the filesystem is mounted, any ordinary unprivileged local user with write access to a directory on it triggers the bug with a single `rmdir()` or `rename()` — no capability, no root, and no `CAP_SYS_ADMIN` is needed for the triggering syscall itself.\nUI:N - No action by a second user is required: on a kiosk, desktop, or embedded system with udisks2/systemd automount, inserting the crafted volume is performed by the attacker and mounting is done by a daemon, after which the attacker issues the `rmdir()` themselves.\nS:U - The damage — corrupted nilfs2 metadata and a wedged log-writer thread — stays entirely within the kernel's own security authority on the affected host; no VM, IOMMU, or sandbox boundary is crossed.\nC:N - The defect is an incorrect boolean return, not a memory-safety violation: `nilfs_check_folio()` still bounds every entry walk, and the `fail:` label in `nilfs_get_folio()` already releases the folio, so there is no out-of-bounds read, no use-after-free, and no kernel pointer or adjacent-memory disclosure.\nI:H - The false \"directory is empty\" verdict lets `nilfs_rmdir()` unlink a populated directory (`i_size = 0`, `drop_nlink()`) and lets `nilfs_rename()` overwrite one, orphaning the entire subtree and, as the fix states, corrupting the file system — silent, unauthorized destruction of stored data and metadata that the kernel then continues to operate on.\nA:H - With a corrupted `i_size` the loop performs an effectively unbounded sequence of failing reads with no `cond_resched()` or signal check while holding `ns_segctor_sem` for read and `sb_start_intwrite()`, so the segctord log writer blocks forever on `down_write()` — the syzbot hung-task hang — stalling all writeback, sync, freeze, and umount on that filesystem and panicking the box if `hung_task_panic` is set."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:33:27.521Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.30","versionEndExcluding":"4.19.317"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.30","versionEndExcluding":"5.4.279"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.30","versionEndExcluding":"5.10.221"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.30","versionEndExcluding":"5.15.162"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.30","versionEndExcluding":"6.1.95"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.30","versionEndExcluding":"6.6.35"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.30","versionEndExcluding":"6.9.5"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.30","versionEndExcluding":"6.10"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://git.kernel.org/stable/c/2ac8a2fe22bdde9eecce2a42cf5cab79333fb428","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/405b71f1251e5ae865f53bd27c45114e6c83bee3","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/c77ad608df6c091fe64ecb91f41ef7cb465587f1","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/11a2edb70356a2202dcb7c9c189c8356ab4752cd","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/129dcd3e7d036218db3f59c82d82004b9539ed82","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/d18b05eda7fa77f02114f15b02c009f28ee42346","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/59f14875a96ef93f05b82ad3c980605f2cb444b5","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/7373a51e7998b508af7136530f3a997b286ce81c","tags":["x_transferred"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T21:56:03.781Z"}},{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2024-39469","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2024-09-10T17:07:55.313333Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-09-11T17:34:41.781Z"}},{"affected":[{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.0","status":"affected","lessThan":"V3.1.5","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.0","status":"affected","lessThan":"V3.1.5","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.0","status":"affected","lessThan":"V3.1.5","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.0","status":"affected","lessThan":"V3.1.5","versionType":"custom"}]},{"vendor":"Siemens","product":"SIPLUS S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.0","status":"affected","lessThan":"V3.1.5","versionType":"custom"}]}],"references":[{"url":"https://cert-portal.siemens.com/productcert/html/ssa-398330.html"},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-355557.html"}],"providerMetadata":{"shortName":"siemens-SADP","orgId":"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e","dateUpdated":"2026-10-15T00:44:10.229Z"},"x_adpType":"supplier"}]}}}