UBUNTU-CVE-2026-74628: Use After Free
In the Linux kernel, the following vulnerability has been resolved: net/x25: fix use-after-free of the socket by its timers The x25 timers are armed with modtimer() and cancelled with timerdelete(), so a pending timer holds no reference on the socket and a cancel does not wait for a callback already running on another CPU. x25heartbeatexpiry() also rearms unconditionally, so it can reinstall sk->sktimer after x25destroysocket() has passed its cancel point. The following sockput() frees the socket while the timer is still queued, and the next expiry uses freed memory. KASAN reports a slab-use-after-free on the kmalloc-2k object freed by close(). timerdeletesync() cannot be used here: x25heartbeatexpiry() and x25timerexpiry() both reach the cancels from inside the timer they would wait on, through x25destroysocket() and x25disconnect(). Arm the timers with skresettimer() and cancel them with skstoptimer() so that an armed timer owns a reference, and release it in both expiry handlers. Rearm the heartbeat only while skhashed(sk) is still true, since x25destroysocket() unlinks the socket before dropping it. Arm the deferred destroy timer the same way and drop its reference in x25destroytimer(). Reproduced on net with KASAN, with the heartbeat period shortened so the window recurs. With this patch the reproducer no longer triggers a report and /proc/net/x25 drains. Discovered by XBOW, triaged by Baul Lee <baul.lee@xbow.com>
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-nvidia-tegrato a version that resolves this vulnerability.Fixed in 6.8.0-1036.39 - Compensating control
Update net/x25 timer handling so the deferred-destroy timer is armed with sk_reset_timer() and its reference is dropped in x25_destroy_timer(); cancel timers with sk_stop_timer() so an armed timer owns a socket reference, release that reference in both x25_heartbeat_expiry() and x25_timer_expiry(), and rearm the heartbeat only while sk_hashed(sk) remains true.