net: defer final 'struct net' free in netns dismantle
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ a8a572a6b5f2a79280d6e302cb3c1cb1fbaeb3e8 · < 0f6ede9fbc747e2553612271bce108f7517e7a45| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net: defer final 'struct net' free in netns dismantle
Ilya reported a slab-use-after-free in dst_destroy [1]
Issue is in xfrm6_net_init() and xfrm4_net_init() :
They copy xfrm[46]_dst_ops_template into net->xfrm.xfrm[46]_dst_ops.
But net structure might be freed before all the dst callbacks are called. So when dst_destroy() calls later :
if (dst->ops->destroy) dst->ops->destroy(dst);
dst->ops points to the old net->xfrm.xfrm[46]_dst_ops, which has been freed.
From the CVE record · Linux
The Linux kernel can free a network namespace structure before all destination callbacks have finished using it, causing a use-after-free in dst_destroy(). The input does not specify how an attacker could trigger the issue or whether network access, authentication, or user interaction is required.
Engineers running the Linux kernel should check their builds; the issue was reported on 6.12.0, but the full affected version range is not provided.