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.
[ { "signature_type": "Line", "id": "CVE-2024-39469-22a37631", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@405b71f1251e5ae865f53bd27c45114e6c83bee3", "signature_version": "v1", "target": { "file": "fs/nilfs2/dir.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "150481701054466909764267368298926439694", "79271559604460975324192288211068897192", "214373080710686608751410979265873130288", "7214945971533915021411053199147715403" ] }, "deprecated": false }, { "signature_type": "Function", "id": "CVE-2024-39469-2e1945c4", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2ac8a2fe22bdde9eecce2a42cf5cab79333fb428", "signature_version": "v1", "target": { "function": "nilfs_empty_dir", "file": "fs/nilfs2/dir.c" }, "digest": { "function_hash": "81251298457598656684340167422879288327", "length": 873.0 }, "deprecated": false }, { "signature_type": "Line", "id": "CVE-2024-39469-35c6f424", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@129dcd3e7d036218db3f59c82d82004b9539ed82", "signature_version": "v1", "target": { "file": "fs/nilfs2/dir.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "150481701054466909764267368298926439694", "79271559604460975324192288211068897192", "214373080710686608751410979265873130288", "7214945971533915021411053199147715403" ] }, "deprecated": false }, { "signature_type": "Function", "id": "CVE-2024-39469-3cc3d789", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7373a51e7998b508af7136530f3a997b286ce81c", "signature_version": "v1", "target": { "function": "nilfs_empty_dir", "file": "fs/nilfs2/dir.c" }, "digest": { "function_hash": "265013586706397074048035429195188090728", "length": 885.0 }, "deprecated": false }, { "signature_type": "Line", "id": "CVE-2024-39469-4b907e89", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7373a51e7998b508af7136530f3a997b286ce81c", "signature_version": "v1", "target": { "file": "fs/nilfs2/dir.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "103926033953399793287027547561525877099", "318316147840047013656881027312440496961", "214373080710686608751410979265873130288", "7214945971533915021411053199147715403" ] }, "deprecated": false }, { "signature_type": "Function", "id": "CVE-2024-39469-5d9e3029", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c77ad608df6c091fe64ecb91f41ef7cb465587f1", "signature_version": "v1", "target": { "function": "nilfs_empty_dir", "file": "fs/nilfs2/dir.c" }, "digest": { "function_hash": "81251298457598656684340167422879288327", "length": 873.0 }, "deprecated": false }, { "signature_type": "Function", "id": "CVE-2024-39469-6641dfbf", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@11a2edb70356a2202dcb7c9c189c8356ab4752cd", "signature_version": "v1", "target": { "function": "nilfs_empty_dir", "file": "fs/nilfs2/dir.c" }, "digest": { "function_hash": "81251298457598656684340167422879288327", "length": 873.0 }, "deprecated": false }, { "signature_type": "Line", "id": "CVE-2024-39469-6aeec151", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@59f14875a96ef93f05b82ad3c980605f2cb444b5", "signature_version": "v1", "target": { "file": "fs/nilfs2/dir.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "103926033953399793287027547561525877099", "318316147840047013656881027312440496961", "214373080710686608751410979265873130288", "7214945971533915021411053199147715403" ] }, "deprecated": false }, { "signature_type": "Function", "id": "CVE-2024-39469-8096126d", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@405b71f1251e5ae865f53bd27c45114e6c83bee3", "signature_version": "v1", "target": { "function": "nilfs_empty_dir", "file": "fs/nilfs2/dir.c" }, "digest": { "function_hash": "81251298457598656684340167422879288327", "length": 873.0 }, "deprecated": false }, { "signature_type": "Line", "id": "CVE-2024-39469-914d616c", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d18b05eda7fa77f02114f15b02c009f28ee42346", "signature_version": "v1", "target": { "file": "fs/nilfs2/dir.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "150481701054466909764267368298926439694", "79271559604460975324192288211068897192", "214373080710686608751410979265873130288", "7214945971533915021411053199147715403" ] }, "deprecated": false }, { "signature_type": "Line", "id": "CVE-2024-39469-a0fa9969", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2ac8a2fe22bdde9eecce2a42cf5cab79333fb428", "signature_version": "v1", "target": { "file": "fs/nilfs2/dir.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "150481701054466909764267368298926439694", "79271559604460975324192288211068897192", "214373080710686608751410979265873130288", "7214945971533915021411053199147715403" ] }, "deprecated": false }, { "signature_type": "Function", "id": "CVE-2024-39469-a9cd3741", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d18b05eda7fa77f02114f15b02c009f28ee42346", "signature_version": "v1", "target": { "function": "nilfs_empty_dir", "file": "fs/nilfs2/dir.c" }, "digest": { "function_hash": "81251298457598656684340167422879288327", "length": 873.0 }, "deprecated": false }, { "signature_type": "Function", "id": "CVE-2024-39469-af5613dc", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@59f14875a96ef93f05b82ad3c980605f2cb444b5", "signature_version": "v1", "target": { "function": "nilfs_empty_dir", "file": "fs/nilfs2/dir.c" }, "digest": { "function_hash": "265013586706397074048035429195188090728", "length": 885.0 }, "deprecated": false }, { "signature_type": "Line", "id": "CVE-2024-39469-c42e3d0c", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c77ad608df6c091fe64ecb91f41ef7cb465587f1", "signature_version": "v1", "target": { "file": "fs/nilfs2/dir.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "150481701054466909764267368298926439694", "79271559604460975324192288211068897192", "214373080710686608751410979265873130288", "7214945971533915021411053199147715403" ] }, "deprecated": false }, { "signature_type": "Line", "id": "CVE-2024-39469-d82d3e74", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@11a2edb70356a2202dcb7c9c189c8356ab4752cd", "signature_version": "v1", "target": { "file": "fs/nilfs2/dir.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "150481701054466909764267368298926439694", "79271559604460975324192288211068897192", "214373080710686608751410979265873130288", "7214945971533915021411053199147715403" ] }, "deprecated": false }, { "signature_type": "Function", "id": "CVE-2024-39469-f43a6e98", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@129dcd3e7d036218db3f59c82d82004b9539ed82", "signature_version": "v1", "target": { "function": "nilfs_empty_dir", "file": "fs/nilfs2/dir.c" }, "digest": { "function_hash": "81251298457598656684340167422879288327", "length": 873.0 }, "deprecated": false } ]