In the Linux kernel, the following vulnerability has been resolved:
nilfs2: fix nilfsemptydir() misjudgment and long loop on I/O errors
The error handling in nilfsemptydir() when a directory folio/page read fails is incorrect, as in the old ext2 implementation, and if the folio/page cannot be read or nilfscheckfolio() fails, it will falsely determine the directory as empty and corrupt the file system.
In addition, since nilfsemptydir() does not immediately return on a failed folio/page read, but continues to loop, this can cause a long loop with I/O if i_size of the directory's inode is also corrupted, causing the log writer thread to wait and hang, as reported by syzbot.
Fix these issues by making nilfsemptydir() immediately return a false value (0) if it fails to get a directory folio/page.
{ "vanir_signatures": [ { "signature_version": "v1", "signature_type": "Line", "target": { "file": "fs/nilfs2/dir.c" }, "id": "CVE-2024-39469-22a37631", "digest": { "line_hashes": [ "150481701054466909764267368298926439694", "79271559604460975324192288211068897192", "214373080710686608751410979265873130288", "7214945971533915021411053199147715403" ], "threshold": 0.9 }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@405b71f1251e5ae865f53bd27c45114e6c83bee3" }, { "signature_version": "v1", "signature_type": "Function", "target": { "file": "fs/nilfs2/dir.c", "function": "nilfs_empty_dir" }, "id": "CVE-2024-39469-2e1945c4", "digest": { "length": 873.0, "function_hash": "81251298457598656684340167422879288327" }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2ac8a2fe22bdde9eecce2a42cf5cab79333fb428" }, { "signature_version": "v1", "signature_type": "Line", "target": { "file": "fs/nilfs2/dir.c" }, "id": "CVE-2024-39469-35c6f424", "digest": { "line_hashes": [ "150481701054466909764267368298926439694", "79271559604460975324192288211068897192", "214373080710686608751410979265873130288", "7214945971533915021411053199147715403" ], "threshold": 0.9 }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@129dcd3e7d036218db3f59c82d82004b9539ed82" }, { "signature_version": "v1", "signature_type": "Function", "target": { "file": "fs/nilfs2/dir.c", "function": "nilfs_empty_dir" }, "id": "CVE-2024-39469-3cc3d789", "digest": { "length": 885.0, "function_hash": "265013586706397074048035429195188090728" }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7373a51e7998b508af7136530f3a997b286ce81c" }, { "signature_version": "v1", "signature_type": "Line", "target": { "file": "fs/nilfs2/dir.c" }, "id": "CVE-2024-39469-4b907e89", "digest": { "line_hashes": [ "103926033953399793287027547561525877099", "318316147840047013656881027312440496961", "214373080710686608751410979265873130288", "7214945971533915021411053199147715403" ], "threshold": 0.9 }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7373a51e7998b508af7136530f3a997b286ce81c" }, { "signature_version": "v1", "signature_type": "Function", "target": { "file": "fs/nilfs2/dir.c", "function": "nilfs_empty_dir" }, "id": "CVE-2024-39469-5d9e3029", "digest": { "length": 873.0, "function_hash": "81251298457598656684340167422879288327" }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c77ad608df6c091fe64ecb91f41ef7cb465587f1" }, { "signature_version": "v1", "signature_type": "Function", "target": { "file": "fs/nilfs2/dir.c", "function": "nilfs_empty_dir" }, "id": "CVE-2024-39469-6641dfbf", "digest": { "length": 873.0, "function_hash": "81251298457598656684340167422879288327" }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@11a2edb70356a2202dcb7c9c189c8356ab4752cd" }, { "signature_version": "v1", "signature_type": "Line", "target": { "file": "fs/nilfs2/dir.c" }, "id": "CVE-2024-39469-6aeec151", "digest": { "line_hashes": [ "103926033953399793287027547561525877099", "318316147840047013656881027312440496961", "214373080710686608751410979265873130288", "7214945971533915021411053199147715403" ], "threshold": 0.9 }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@59f14875a96ef93f05b82ad3c980605f2cb444b5" }, { "signature_version": "v1", "signature_type": "Function", "target": { "file": "fs/nilfs2/dir.c", "function": "nilfs_empty_dir" }, "id": "CVE-2024-39469-8096126d", "digest": { "length": 873.0, "function_hash": "81251298457598656684340167422879288327" }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@405b71f1251e5ae865f53bd27c45114e6c83bee3" }, { "signature_version": "v1", "signature_type": "Line", "target": { "file": "fs/nilfs2/dir.c" }, "id": "CVE-2024-39469-914d616c", "digest": { "line_hashes": [ "150481701054466909764267368298926439694", "79271559604460975324192288211068897192", "214373080710686608751410979265873130288", "7214945971533915021411053199147715403" ], "threshold": 0.9 }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d18b05eda7fa77f02114f15b02c009f28ee42346" }, { "signature_version": "v1", "signature_type": "Line", "target": { "file": "fs/nilfs2/dir.c" }, "id": "CVE-2024-39469-a0fa9969", "digest": { "line_hashes": [ "150481701054466909764267368298926439694", "79271559604460975324192288211068897192", "214373080710686608751410979265873130288", "7214945971533915021411053199147715403" ], "threshold": 0.9 }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2ac8a2fe22bdde9eecce2a42cf5cab79333fb428" }, { "signature_version": "v1", "signature_type": "Function", "target": { "file": "fs/nilfs2/dir.c", "function": "nilfs_empty_dir" }, "id": "CVE-2024-39469-a9cd3741", "digest": { "length": 873.0, "function_hash": "81251298457598656684340167422879288327" }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d18b05eda7fa77f02114f15b02c009f28ee42346" }, { "signature_version": "v1", "signature_type": "Function", "target": { "file": "fs/nilfs2/dir.c", "function": "nilfs_empty_dir" }, "id": "CVE-2024-39469-af5613dc", "digest": { "length": 885.0, "function_hash": "265013586706397074048035429195188090728" }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@59f14875a96ef93f05b82ad3c980605f2cb444b5" }, { "signature_version": "v1", "signature_type": "Line", "target": { "file": "fs/nilfs2/dir.c" }, "id": "CVE-2024-39469-c42e3d0c", "digest": { "line_hashes": [ "150481701054466909764267368298926439694", "79271559604460975324192288211068897192", "214373080710686608751410979265873130288", "7214945971533915021411053199147715403" ], "threshold": 0.9 }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c77ad608df6c091fe64ecb91f41ef7cb465587f1" }, { "signature_version": "v1", "signature_type": "Line", "target": { "file": "fs/nilfs2/dir.c" }, "id": "CVE-2024-39469-d82d3e74", "digest": { "line_hashes": [ "150481701054466909764267368298926439694", "79271559604460975324192288211068897192", "214373080710686608751410979265873130288", "7214945971533915021411053199147715403" ], "threshold": 0.9 }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@11a2edb70356a2202dcb7c9c189c8356ab4752cd" }, { "signature_version": "v1", "signature_type": "Function", "target": { "file": "fs/nilfs2/dir.c", "function": "nilfs_empty_dir" }, "id": "CVE-2024-39469-f43a6e98", "digest": { "length": 873.0, "function_hash": "81251298457598656684340167422879288327" }, "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@129dcd3e7d036218db3f59c82d82004b9539ed82" } ] }