{"id":"CVE-2024-50230","state":"PUBLISHED","title":"nilfs2: fix kernel bug due to missing clearing of checked flag","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnilfs2: fix kernel bug due to missing clearing of checked flag\n\nSyzbot reported that in directory operations after nilfs2 detects\nfilesystem corruption and degrades to read-only,\n__block_write_begin_int(), which is called to prepare block writes, may\nfail the BUG_ON check for accesses exceeding the folio/page size,\ntriggering a kernel bug.\n\nThis was found to be because the \"checked\" flag of a page/folio was not\ncleared when it was discarded by nilfs2's own routine, which causes the\nsanity check of directory entries to be skipped when the directory\npage/folio is reloaded.  So, fix that.\n\nThis was necessary when the use of nilfs2's own page discard routine was\napplied to more than just metadata files.","publishedAt":"2024-11-09T10:14:40.576Z","updatedAt":"2026-08-05T11:42:39.000Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"994b2fa13a6c9cf3feca93090a9c337d48e3d60d","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"64afad73e4623308d8943645e5631f2c7a2d7971","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"aa0cee46c5d3fd9a39575a4c8a4f65f25f095b89","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"f05dbebb8ee34882505d53d83af7d18f28a49248","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"cd0cdb51b15203fa27d4b714be83b7dfffa0b752","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"f2f1fa446676c21edb777e6d2bc4fa8f956fab68","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"56c6171932a7fb267ac6cb4ff8759b93ee1d0e2e","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"41e192ad2779cae0102879612dfe46726e4396aa","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nilfs2/page.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.10","versionType":"semver"},{"version":"4.19.323","status":"unaffected","lessThanOrEqual":"4.19.*","versionType":"semver"},{"version":"5.4.285","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.229","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.171","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.116","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.60","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.11.7","status":"unaffected","lessThanOrEqual":"6.11.*","versionType":"semver"},{"version":"6.12","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nilfs2/page.c"]}],"references":["https://git.kernel.org/stable/c/994b2fa13a6c9cf3feca93090a9c337d48e3d60d","https://git.kernel.org/stable/c/64afad73e4623308d8943645e5631f2c7a2d7971","https://git.kernel.org/stable/c/aa0cee46c5d3fd9a39575a4c8a4f65f25f095b89","https://git.kernel.org/stable/c/f05dbebb8ee34882505d53d83af7d18f28a49248","https://git.kernel.org/stable/c/cd0cdb51b15203fa27d4b714be83b7dfffa0b752","https://git.kernel.org/stable/c/f2f1fa446676c21edb777e6d2bc4fa8f956fab68","https://git.kernel.org/stable/c/56c6171932a7fb267ac6cb4ff8759b93ee1d0e2e","https://git.kernel.org/stable/c/41e192ad2779cae0102879612dfe46726e4396aa","https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html","https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"],"weaknesses":["CWE-787"],"ingestedAt":"2026-10-29T20:07:56.516Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/50xxx/CVE-2024-50230.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-50230","state":"PUBLISHED","datePublished":"2024-11-09T10:14:40.576Z","dateUpdated":"2026-08-05T11:42:39.000Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-10-21T19:36:19.973Z"},"containers":{"cna":{"title":"nilfs2: fix kernel bug due to missing clearing of checked flag","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnilfs2: fix kernel bug due to missing clearing of checked flag\n\nSyzbot reported that in directory operations after nilfs2 detects\nfilesystem corruption and degrades to read-only,\n__block_write_begin_int(), which is called to prepare block writes, may\nfail the BUG_ON check for accesses exceeding the folio/page size,\ntriggering a kernel bug.\n\nThis was found to be because the \"checked\" flag of a page/folio was not\ncleared when it was discarded by nilfs2's own routine, which causes the\nsanity check of directory entries to be skipped when the directory\npage/folio is reloaded.  So, fix that.\n\nThis was necessary when the use of nilfs2's own page discard routine was\napplied to more than just metadata files."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"994b2fa13a6c9cf3feca93090a9c337d48e3d60d","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"64afad73e4623308d8943645e5631f2c7a2d7971","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"aa0cee46c5d3fd9a39575a4c8a4f65f25f095b89","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"f05dbebb8ee34882505d53d83af7d18f28a49248","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"cd0cdb51b15203fa27d4b714be83b7dfffa0b752","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"f2f1fa446676c21edb777e6d2bc4fa8f956fab68","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"56c6171932a7fb267ac6cb4ff8759b93ee1d0e2e","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"41e192ad2779cae0102879612dfe46726e4396aa","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nilfs2/page.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.10","versionType":"semver"},{"version":"4.19.323","status":"unaffected","lessThanOrEqual":"4.19.*","versionType":"semver"},{"version":"5.4.285","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.229","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.171","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.116","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.60","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.11.7","status":"unaffected","lessThanOrEqual":"6.11.*","versionType":"semver"},{"version":"6.12","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nilfs2/page.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/994b2fa13a6c9cf3feca93090a9c337d48e3d60d"},{"url":"https://git.kernel.org/stable/c/64afad73e4623308d8943645e5631f2c7a2d7971"},{"url":"https://git.kernel.org/stable/c/aa0cee46c5d3fd9a39575a4c8a4f65f25f095b89"},{"url":"https://git.kernel.org/stable/c/f05dbebb8ee34882505d53d83af7d18f28a49248"},{"url":"https://git.kernel.org/stable/c/cd0cdb51b15203fa27d4b714be83b7dfffa0b752"},{"url":"https://git.kernel.org/stable/c/f2f1fa446676c21edb777e6d2bc4fa8f956fab68"},{"url":"https://git.kernel.org/stable/c/56c6171932a7fb267ac6cb4ff8759b93ee1d0e2e"},{"url":"https://git.kernel.org/stable/c/41e192ad2779cae0102879612dfe46726e4396aa"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The vulnerable code is reached only through a locally mounted nilfs2 block device — mount(2) plus ordinary directory syscalls (getdents, creat, unlink, rename) on that mount; no network protocol handler is involved. Attack Vector is Local rather than Physical because the attacker supplies image data (USB stick, disk image, container volume) and need not touch hardware.\nAC:L - The attacker fully controls the crafted nilfs2 image, so they choose the corruption that forces nilfs_error() into read-only degrade, and they can force the discard-then-reload sequence on demand with sync(2)/fsync(2) followed by a directory access. Nothing depends on conditions outside their influence, and the sequence can be retried indefinitely (syzbot reproduces it).\nPR:N - The attacker needs no account or privilege on the target system — they only supply the crafted nilfs2 medium, and the image can be built so that mount plus routine directory browsing by the victim (file manager readdir/lookup, thumbnailer) drives the corrupted path itself. This matches the established framing for crafted-filesystem-image flaws.\nUI:R - nilfs2 is FS_REQUIRES_DEV with no FS_USERNS_MOUNT, so the crafted image must be mounted by a privileged actor — a victim inserting the removable medium into a desktop/kiosk with udisks2 automount, an admin mounting a supplied image, or a loop mount inside a container.\nS:U - The out-of-bounds access and the BUG() occur inside the kernel's own memory and locking domain on the same system; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - Bypassing nilfs_check_folio() lets nilfs_readdir() pass an unvalidated de->name_len (up to 255) to dir_emit() for an entry only 12 bytes from the folio end, leaking roughly 250 bytes of adjacent kernel heap directly into a userspace getdents() buffer. That is far more than a strictly bounded few-byte read, and it also exposes nilfs2 private metadata inodes through lookup.\nI:H - With the sanity gate skipped, nilfs_add_link() and nilfs_delete_entry() perform entry splitting and merging (de1->rec_len writes, memcpy into de->name, pde->rec_len rewrites) using offsets derived from unvalidated on-disk rec_len/name_len, corrupting directory data and filesystem metadata. The bypassed NILFS_PRIVATE_INODE check further permits directory entries to resolve to nilfs2's DAT/cpfile/sufile/ifile inodes, giving a type-confusion primitive against internal metadata.\nA:H - The reported and primary outcome is BUG_ON(to > folio_size(folio)) in __block_write_begin_int(), a kernel BUG taken while holding the folio lock and directory inode lock, which oopses the task and leaves the filesystem permanently wedged, or panics outright with panic_on_oops."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:42:39.000Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.10","versionEndExcluding":"4.19.323"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.10","versionEndExcluding":"5.4.285"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.10","versionEndExcluding":"5.10.229"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.10","versionEndExcluding":"5.15.171"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.10","versionEndExcluding":"6.1.116"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.10","versionEndExcluding":"6.6.60"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.10","versionEndExcluding":"6.11.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.10","versionEndExcluding":"6.12"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.8,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"id":"CVE-2024-50230","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2025-10-01T20:16:44.018414Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-787","lang":"en","type":"CWE","description":"CWE-787 Out-of-bounds Write"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-10-01T20:17:27.750Z"}},{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html"},{"url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T22:27:11.058Z"}}]}}}