nilfs2: reject zero bd_oblocknr in nilfs_ioctl_mark_blocks_dirty()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 7942b919f7321f95a777d396ff7894a7a83dc9b0 · < e5ff0ba4b6983cdbcc826efc201e7179ece5d46f| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nilfs2: reject zero bd_oblocknr in nilfs_ioctl_mark_blocks_dirty()
nilfs_ioctl_mark_blocks_dirty() uses bd_oblocknr to detect dead blocks by comparing it with the current block number bd_blocknr. If they differ, the block is considered dead and skipped.
However, bd_oblocknr should never be 0 since block 0 typically stores the primary superblock and is never a valid GC target block. A corrupted ioctl request with bd_oblocknr set to 0 causes the comparison to incorrectly match when the lookup returns -ENOENT and sets bd_blocknr to 0, bypassing the dead block check and calling nilfs_bmap_mark() on a non-existent block. This causes nilfs_btree_do_lookup() to return -ENOENT, triggering the WARN_ON(ret == -ENOENT).
Fix this by rejecting ioctl requests with bd_oblocknr set to 0 at the beginning of each iteration.
[ryusuke: slightly modified the commit message and comments for accuracy]
From the CVE record · Linux
The Linux kernel’s nilfs2 ioctl handling fails to reject a zero bd_oblocknr in a corrupted mark-blocks-dirty request. A local caller submitting such a request can bypass the dead-block check and trigger a kernel warning; the input does not specify authentication requirements or further user interaction.
Engineers running Linux kernels with nilfs2 should check their exposure; affected versions are not specified.