tipc: fix UAF in tipc_l2_send_msg()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 282b3a056225b35024246f63feb91d769d714dad · < 0d8a12d7143126afdf9fbe2e3d438650dd6603ed| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
tipc: fix UAF in tipc_l2_send_msg()
Syzbot reported a slab-use-after-free in ipvlan_hard_header() when called from tipc_l2_send_msg().
The root cause is that tipc_disable_l2_media() calls synchronize_net() while b->media_ptr is still valid. This allows concurrent RCU readers to obtain the device pointer after synchronize_net() has finished. The pointer is cleared later in bearer_disable(), but without any subsequent synchronization, allowing the device to be freed while still in use by readers.
Fix this by clearing b->media_ptr in tipc_disable_l2_media() before calling synchronize_net().
This is safe to do now because the call order in bearer_disable() was reversed in 0d051bf93c06 ("tipc: make bearer packet filtering generic") to call tipc_node_delete_links() (which needs the pointer) before disable_media().
https: //lore.kernel.org/netdev/6a2c1007.428ffe26.258b27.015d.GAE@google.com/T/#u
From the CVE record · Linux
The Linux kernel’s TIPC L2 messaging path has a use-after-free caused by a device pointer remaining accessible to concurrent readers during media disablement. This can result in a slab-use-after-free; the input does not establish how an attacker could trigger it or whether network access, authentication, or user interaction is required.
Engineers running Linux kernels with TIPC should check their deployments; affected versions are not specified.