tls: Use __sk_dst_get() and dst_dev_rcu() in get_netdev_for_sock().
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e8f69799810c32dd40c6724d829eccc70baad07f · < c65f27b9c3be2269918e1cbad6d8884741f835c5| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
tls: Use __sk_dst_get() and dst_dev_rcu() in get_netdev_for_sock().
get_netdev_for_sock() is called during setsockopt(), so not under RCU.
Using sk_dst_get(sk)->dev could trigger UAF.
Let's use __sk_dst_get() and dst_dev_rcu().
Note that the only ->ndo_sk_get_lower_dev() user is bond_sk_get_lower_dev(), which uses RCU.
From the CVE record · Linux
The Linux kernel's TLS socket device lookup can use a destination device without the required RCU protection during setsockopt(). A local caller invoking setsockopt() could trigger a use-after-free; the input does not specify authentication requirements or user interaction.
Anyone running the Linux kernel should check whether their kernel includes the fix; affected versions are not specified.