nilfs2: validate directory position after llseek in readdir
- State
- Published
- Severity
- Not Scored
- Published
- Nov 30, 2026
- Updated
- Nov 30, 2026
- Reserved
- Nov 30, 2026
Description
In the Linux kernel, the following vulnerability has been resolved:
nilfs2: validate directory position after llseek in readdir
nilfs_readdir() uses ctx->pos, which userspace can set to an arbitrary value via llseek, as an offset into the directory folio and parses whatever bytes sit there as a directory entry. A position pointing into the middle of an entry -- or at unused bytes of a corrupted image that the page validator never inspected -- makes dir_emit() copy up to 255 (name_len) bytes from a bogus entry, possibly reading past the end of the folio and returning unrelated memory contents to userspace.
Snap unaligned positions onto a valid entry boundary by walking the rec_len chain from the chunk start before parsing, as ext2 does in ext2_validate_entry().
[ryusuke: fixed offset wrap-around in nilfs_validate_entry() and conformed AI tag to guidelines]
| Product | Versions |
|---|---|
| Linux Linux | 2ba466d74ed74f073257f86e61519cb8f8f46184 to before bdfc5b64f8f606df9c1dc18c2e00200884c8e6f5 Affected2ba466d74ed74f073257f86e61519cb8f8f46184 to before 69cf95f47a68b6920c9192a5ea3fe8c1db0a1070 Affected2ba466d74ed74f073257f86e61519cb8f8f46184 to before 07f671d13067e68dbc840e46027668293c1c3a80 Affected2ba466d74ed74f073257f86e61519cb8f8f46184 to before a48632160cdb85adadb4b7c8429d90a9511e7e6b Affected2ba466d74ed74f073257f86e61519cb8f8f46184 to before dc171da15e46871abac4c05b389730883c15f680 Affected2ba466d74ed74f073257f86e61519cb8f8f46184 to before 7bcffd24502d637b348a2e460093a0cabad4554e Affected2ba466d74ed74f073257f86e61519cb8f8f46184 to before fbcbb54a4898984192b16764943af1be262bdb4d Affected2ba466d74ed74f073257f86e61519cb8f8f46184 to before de7f49c12566cc5c7437a2f26c6c754b9d4d5648 Affected |
| Linux Linux | 2.6.30 Affectedbefore 2.6.30 Not Affected5.10.275 through 5.10.* Not Affected5.15.226 through 5.15.* Not Affected6.1.193 through 6.1.* Not Affected6.6.163 through 6.6.* Not Affected6.12.117 through 6.12.* Not Affected6.18.63 through 6.18.* Not Affected7.3.4 through 7.3.* Not Affected7.4-rc1 and later Not Affected |
The record has no CVSS score.
Weaknesses
The record names no weakness.
References
- https://git.kernel.org/stable/c/bdfc5b64f8f606df9c1dc18c2e00200884c8e6f5
- https://git.kernel.org/stable/c/69cf95f47a68b6920c9192a5ea3fe8c1db0a1070
- https://git.kernel.org/stable/c/07f671d13067e68dbc840e46027668293c1c3a80
- https://git.kernel.org/stable/c/a48632160cdb85adadb4b7c8429d90a9511e7e6b
- https://git.kernel.org/stable/c/dc171da15e46871abac4c05b389730883c15f680
- https://git.kernel.org/stable/c/7bcffd24502d637b348a2e460093a0cabad4554e
- https://git.kernel.org/stable/c/fbcbb54a4898984192b16764943af1be262bdb4d
- https://git.kernel.org/stable/c/de7f49c12566cc5c7437a2f26c6c754b9d4d5648
Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.