Linux kernel use-after-free in TCP request socket timer handling
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
4.2
|
In the Linux kernel, the following vulnerability has been resolved:
tcp: Fix potential UAF in reqsk_timer_handler().
When TCP socket migration fails at inet_ehash_insert() in reqsk_timer_handler(), we jump to the no_ownership: label and free the new reqsk immediately with __reqsk_free().
Thus, we must stop the new reqsk's timer before jumping to the label, but the timer might be missed since the cited commit, resulting in UAF.
As we are in the original reqsk's timer context, we can safely call timer_delete_sync() for the new reqsk.
Let's pass false to __inet_csk_reqsk_queue_drop() to stop the new reqsk's timer.
From the CVE record · Linux
The Linux kernel’s TCP request socket timer handler can use freed memory if socket migration fails during request socket insertion and the new socket’s timer is not stopped. The input does not specify how an attacker could trigger this condition or whether authentication or user interaction is required.
Operators running Linux kernels should check their kernel versions; affected versions are not specified.