CVE-2022-50864 nilfs2: fix shift-out-of-bounds due to too large exponent of block size
A local attacker can cause a kernel panic via a crafted nilfs2 filesystem image due to an integer overflow in block size handling.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2022-50864?
CVE-2022-50864 is a vulnerability in Linux, published on 30 Dec 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
In the Linux kernel, the following vulnerability has been resolved:
nilfs2: fix shift-out-of-bounds due to too large exponent of block size
If field s_log_block_size of superblock data is corrupted and too large, init_nilfs() and load_nilfs() still can trigger a shift-out-of-bounds warning followed by a kernel panic (if panic_on_warn is set):
shift exponent 38973 is too large for 32-bit type 'int' Call Trace: <TASK> dump_stack_lvl+0xcd/0x134 ubsan_epilogue+0xb/0x50 __ubsan_handle_shift_out_of_bounds.cold.12+0x17b/0x1f5 init_nilfs.cold.11+0x18/0x1d [nilfs2] nilfs_mount+0x9b5/0x12b0 [nilfs2] ...
This fixes the issue by adding and using a new helper function for getting block size with sanity check.
Which versions are affected by CVE-2022-50864?
How do I fix CVE-2022-50864?
Apply the vendor's patch.
Is CVE-2022-50864 being exploited?
There is no known exploitation of CVE-2022-50864 in the wild and no public exploit code.
Sources
Also known as DEBIAN-CVE-2022-50864, GHSA-gfhq-qmg6-x4ch, UBUNTU-CVE-2022-50864.