CVE-2026-31474 can: isotp: fix tx.buf use-after-free in isotp_sendmsg()
A use-after-free in the Linux kernel's ISO-TP CAN protocol allows attackers to cause denial of service or execute arbitrary code via race conditions.
- 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-2026-31474?
CVE-2026-31474 is a high-severity use after free vulnerability in Linux kernel, published on 22 Apr 2026. 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:
can: isotp: fix tx.buf use-after-free in isotp_sendmsg()
isotp_sendmsg() uses only cmpxchg() on so->tx.state to serialize access to so->tx.buf. isotp_release() waits for ISOTP_IDLE via wait_event_interruptible() and then calls kfree(so->tx.buf).
If a signal interrupts the wait_event_interruptible() inside close() while tx.state is ISOTP_SENDING, the loop exits early and release proceeds to force ISOTP_SHUTDOWN and continues to kfree(so->tx.buf) while sendmsg may still be reading so->tx.buf for the final CAN frame in isotp_fill_dataframe().
The so->tx.buf can be allocated once when the standard tx.buf length needs to be extended. Move the kfree() of this potentially extended tx.buf to sk_destruct time when either isotp_sendmsg() and isotp_release() are done.
Which versions are affected by CVE-2026-31474?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2026-31474?
Apply the vendor's patch.
Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.
Is CVE-2026-31474 being exploited?
There is no known exploitation of CVE-2026-31474 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as AZL-83225, BELL-CVE-2026-31474, DEBIAN-CVE-2026-31474, GHSA-6p7x-c5rv-9w7v, ROOT-OS-DEBIAN-13-CVE-2026-31474, ROOT-OS-UBUNTU-2404-CVE-2026-31474 and 1 more.