CVE-2024-42084 ftruncate: pass a signed offset
A missing sign extension in the Linux kernel ftruncate syscall allows attackers to truncate files to unintended large sizes, potentially causing data loss.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-42084?
CVE-2024-42084 is a medium-severity vulnerability in Linux kernel, published on 29 Jul 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
In the Linux kernel, the following vulnerability has been resolved:
ftruncate: pass a signed offset
The old ftruncate() syscall, using the 32-bit off_t misses a sign extension when called in compat mode on 64-bit architectures. As a result, passing a negative length accidentally succeeds in truncating to file size between 2GiB and 4GiB.
Changing the type of the compat syscall to the signed compat_off_t changes the behavior so it instead returns -EINVAL.
The native entry point, the truncate() syscall and the corresponding loff_t based variants are all correct already and do not suffer from this mistake.
Which versions are affected by CVE-2024-42084?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2024-42084?
Apply the vendor's patch.
Is CVE-2024-42084 being exploited?
There is no known exploitation of CVE-2024-42084 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as BELL-CVE-2024-42084, DEBIAN-CVE-2024-42084, GHSA-h3c9-8xwq-2j95, UBUNTU-CVE-2024-42084.