Linux · Linux Kernel · CVE-2024-50154
Name of the Vulnerable Software and Affected Versions:
Linux kernel versions prior to 6.6.61
Description:
A use-after-free vulnerability was reported in the Linux kernel's TCP timer handling. The issue occurs when the `req->sk` is closed before the timer expiration, which is 63 seconds by default. This can happen in a scenario where `inet csk complete hashdance()` calls `inet csk reqsk queue drop()`, but `del timer sync()` is missed, allowing the reqsk timer to continue running and sending multiple SYN+ACKs until it expires. The vulnerability can be exploited by attaching a BPF program to `trace tcp retransmit synack`, which passes the `req->sk` to the `bpf sk storage get tracing` kernel helper.
Recommendations:
To resolve the issue, update the Linux kernel to version 6.6.61 or later. As a temporary workaround, consider disabling the `bpf sk storage get tracing` function until a patch is available. Restrict access to the vulnerable `reqsk queue unlink` function to minimize the risk of exploitation. Avoid using the `timer pending()` function in `reqsk queue unlink()` until the issue is resolved.