{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2023-54140",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2025-12-24T13:02:52.522Z",
        "datePublished": "2025-12-24T13:06:54.784Z",
        "dateUpdated": "2026-08-05T09:17:35.344Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T09:17:35.344Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnilfs2: fix WARNING in mark_buffer_dirty due to discarded buffer reuse\n\nA syzbot stress test using a corrupted disk image reported that\nmark_buffer_dirty() called from __nilfs_mark_inode_dirty() or\nnilfs_palloc_commit_alloc_entry() may output a kernel warning, and can\npanic if the kernel is booted with panic_on_warn.\n\nThis is because nilfs2 keeps buffer pointers in local structures for some\nmetadata and reuses them, but such buffers may be forcibly discarded by\nnilfs_clear_dirty_page() in some critical situations.\n\nThis issue is reported to appear after commit 28a65b49eb53 (\"nilfs2: do\nnot write dirty data after degenerating to read-only\"), but the issue has\npotentially existed before.\n\nFix this issue by checking the uptodate flag when attempting to reuse an\ninternally held buffer, and reloading the metadata instead of reusing the\nbuffer if the flag was lost."
                }
            ],
            "metrics": [
                {
                    "cvssV3_1": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
                        "baseScore": 7.8,
                        "baseSeverity": "HIGH"
                    },
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "AV:L - The flaw is reached through ordinary local filesystem syscalls (mkdir, write, unlink) against a mounted nilfs2 volume, plus attacker-supplied on-disk image content; there is no network-facing path into fs/nilfs2.\nAC:L - The attacker fully controls both preconditions — a crafted corrupted nilfs2 image drives the deterministic __nilfs_error()/read-only degeneration that force-clears the buffers, and the attacker's own subsequent syscall reuses the stale cached buffer; syzbot has a reliable reproducer.\nPR:L - Once the volume is mounted, an unprivileged local user triggers the reuse through unprivileged VFS operations with no capability check on the path; the image reaches the kernel via removable media that desktop/kiosk auto-mounters mount without user privilege, matching the PR:L assigned to the same-family nilfs2 buffer-state CVEs.\nUI:N - On an auto-mounting host or an already-mounted shared nilfs2 volume, the attacker's own syscalls are sufficient and no victim action is needed to reach the vulnerable reuse.\nS:U - The corrupted buffer state and resulting panic are confined to the kernel's own security authority with no crossing into a hypervisor, IOMMU, or other authority.\nC:H - Reusing a discarded, non-uptodate buffer makes nilfs2 commit stale ifile/DAT allocator bitmaps, so the same inode number or DAT virtual blocknr can be handed out twice and distinct files alias the same on-disk blocks, exposing other users' file contents.\nI:H - mark_buffer_dirty() on a stale, unmapped buffer causes garbage inode blocks and allocator bitmaps to be written into the log, corrupting on-disk metadata and enabling cross-file block aliasing — arbitrary modification of data the attacker does not own.\nA:H - The reuse hits WARN_ON_ONCE(!buffer_uptodate(bh)) in mark_buffer_dirty(), which is an outright kernel panic on panic_on_warn systems, and the resulting buffer-state inconsistency drives further filesystem failures."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "fs/nilfs2/alloc.c",
                        "fs/nilfs2/inode.c"
                    ],
                    "versions": [
                        {
                            "version": "8c26c4e2694a163d525976e804d81cd955bbb40c",
                            "lessThan": "473795610594f261e98920f0945550314df36f07",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "8c26c4e2694a163d525976e804d81cd955bbb40c",
                            "lessThan": "d95e403588738c7ec38f52b9f490b15e7745d393",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "8c26c4e2694a163d525976e804d81cd955bbb40c",
                            "lessThan": "99a73016a5e12a09586a96f998e91f9ea145cd00",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "8c26c4e2694a163d525976e804d81cd955bbb40c",
                            "lessThan": "f1d637b63d8a27ac3386f186a694907f2717fc13",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "8c26c4e2694a163d525976e804d81cd955bbb40c",
                            "lessThan": "b911bef132a06de01a745c6a24172d6db7216333",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "8c26c4e2694a163d525976e804d81cd955bbb40c",
                            "lessThan": "4da07e958bfda2d69d83db105780e8916e3ac02e",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "8c26c4e2694a163d525976e804d81cd955bbb40c",
                            "lessThan": "46c11be2dca295742a5508ea910a77f7733fb7f4",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "8c26c4e2694a163d525976e804d81cd955bbb40c",
                            "lessThan": "b308b3eabc429649b5501d36290cea403fbd746c",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "8c26c4e2694a163d525976e804d81cd955bbb40c",
                            "lessThan": "cdaac8e7e5a059f9b5e816cda257f08d0abffacd",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "fs/nilfs2/alloc.c",
                        "fs/nilfs2/inode.c"
                    ],
                    "versions": [
                        {
                            "version": "3.10",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "3.10",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "4.14.326",
                            "lessThanOrEqual": "4.14.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "4.19.295",
                            "lessThanOrEqual": "4.19.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.4.257",
                            "lessThanOrEqual": "5.4.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.10.195",
                            "lessThanOrEqual": "5.10.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.15.131",
                            "lessThanOrEqual": "5.15.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.1.52",
                            "lessThanOrEqual": "6.1.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.4.15",
                            "lessThanOrEqual": "6.4.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.5.2",
                            "lessThanOrEqual": "6.5.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.6",
                            "lessThanOrEqual": "*",
                            "status": "unaffected",
                            "versionType": "original_commit_for_fix"
                        }
                    ]
                }
            ],
            "cpeApplicability": [
                {
                    "nodes": [
                        {
                            "operator": "OR",
                            "negate": false,
                            "cpeMatch": [
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.10",
                                    "versionEndExcluding": "4.14.326"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.10",
                                    "versionEndExcluding": "4.19.295"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.10",
                                    "versionEndExcluding": "5.4.257"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.10",
                                    "versionEndExcluding": "5.10.195"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.10",
                                    "versionEndExcluding": "5.15.131"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.10",
                                    "versionEndExcluding": "6.1.52"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.10",
                                    "versionEndExcluding": "6.4.15"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.10",
                                    "versionEndExcluding": "6.5.2"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.10",
                                    "versionEndExcluding": "6.6"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/473795610594f261e98920f0945550314df36f07"
                },
                {
                    "url": "https://git.kernel.org/stable/c/d95e403588738c7ec38f52b9f490b15e7745d393"
                },
                {
                    "url": "https://git.kernel.org/stable/c/99a73016a5e12a09586a96f998e91f9ea145cd00"
                },
                {
                    "url": "https://git.kernel.org/stable/c/f1d637b63d8a27ac3386f186a694907f2717fc13"
                },
                {
                    "url": "https://git.kernel.org/stable/c/b911bef132a06de01a745c6a24172d6db7216333"
                },
                {
                    "url": "https://git.kernel.org/stable/c/4da07e958bfda2d69d83db105780e8916e3ac02e"
                },
                {
                    "url": "https://git.kernel.org/stable/c/46c11be2dca295742a5508ea910a77f7733fb7f4"
                },
                {
                    "url": "https://git.kernel.org/stable/c/b308b3eabc429649b5501d36290cea403fbd746c"
                },
                {
                    "url": "https://git.kernel.org/stable/c/cdaac8e7e5a059f9b5e816cda257f08d0abffacd"
                }
            ],
            "title": "nilfs2: fix WARNING in mark_buffer_dirty due to discarded buffer reuse",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        }
    }
}