ext4: inline: fix len overflow in ext4_prepare_inline_data
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ f19d5870cbf72d4cb2a8e1f749dff97af99b071e · < 5766da2237e539f259aa0e5f3639ae37b44ca458| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ext4: inline: fix len overflow in ext4_prepare_inline_data
When running the following code on an ext4 filesystem with inline_data feature enabled, it will lead to the bug below.
fd = open("file1", O_RDWR | O_CREAT | O_TRUNC, 0666); ftruncate(fd, 30); pwrite(fd, "a", 1, (1UL << 40) + 5UL);
That happens because write_begin will succeed as when ext4_generic_write_inline_data calls ext4_prepare_inline_data, pos + len will be truncated, leading to ext4_prepare_inline_data parameter to be 6 instead of 0x10000000006.
Then, later when write_end is called, we hit:
BUG_ON(pos + len > EXT4_I(inode)->i_inline_size);
at ext4_write_inline_data.
From the CVE record · Linux
The Linux kernel's ext4 inline data handling can truncate a write length, triggering a kernel BUG during a subsequent write. A local user able to write to an ext4 filesystem with the inline_data feature enabled can trigger the crash; no additional user interaction is described.
Engineers running Linux kernels with ext4 filesystems that have inline_data enabled should check their exposure; affected versions are not specified.