tipc: Fix use-after-free in tipc_conn_close().
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ c5fa7b3cf3cb22e4ac60485fc2dc187fe012910f · < 50aa2d121bc2cfe2d825f8a331ea75dfaaab6a50| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
tipc: Fix use-after-free in tipc_conn_close().
syzbot reported a null-ptr-deref in tipc_conn_close() during netns dismantle. [0]
tipc_topsrv_stop() iterates tipc_net(net)->topsrv->conn_idr and calls tipc_conn_close() for each tipc_conn.
The problem is that tipc_conn_close() is called after releasing the IDR lock.
At the same time, there might be tipc_conn_recv_work() running and it could call tipc_conn_close() for the same tipc_conn and release its last ->kref.
Once we release the IDR lock in tipc_topsrv_stop(), there is no guarantee that the tipc_conn is alive.
Let's hold the ref before releasing the lock and put the ref after tipc_conn_close() in tipc_topsrv_stop().
From the CVE record · Linux
A race in the Linux kernel’s TIPC connection teardown can cause tipc_conn_close() to access a freed connection during network namespace cleanup. A use-after-free was observed; the input does not establish how an attacker could trigger it or specify authentication or user-interaction requirements.
Engineers running Linux kernels with TIPC should check their exposure; affected versions are not specified.