CVE-2024-50186
net: explicitly clear the sk pointer, when pf->create fails
Reported by linux · Published November 8, 2024
In the Linux kernel, the following vulnerability has been resolved: net: explicitly clear the sk pointer, when pf->create fails We have recently noticed the exact same KASAN splat as in commit 6cd4a78d962b ("net: do not leave a dangling sk pointer, when socket creation fails"). The problem is that commit did not fully address the problem, as some pf->create implementations do not use sk_common_release in their error paths. For example, we can use the same reproducer as in the above commit, but changing ping to arping. arping uses AF_PACKET socket and if packet_create fails, it will just sk_free the allocated sk object. While we could chase all the pf->create implementations and make sure they NULL the freed sk object on error from the socket, we can't guarantee future protocols will not make the same mistake. So it is easier to just explicitly NULL the sk pointer upon return from pf->create in __sock_create. We do know that pf->create always releases the allocated sk object on error, so if the pointer is not NULL, it is definitely dangling.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 78e4aa528a7b1204219d808310524344f627d069, 893eeba94c40d513cd0fe6539330ebdaea208c0e, 454c454ed645fed051216b79622f7cb69c1638f5 |
| Linux | Linux | 6.10, 0, 5.15.168 |
| linux | linux_kernel | 6.9.7, 6.10, 6.1.96 |
| amazon:2023 | python3-perf | 0 |
| amazon:2023 | kernel-libbpf | 0 |
| amazon:2023 | kernel-headers | 0 |
| amazon:2023 | kernel | 0 |
| amazon:2023 | kernel-livepatch-6.1.115-126.197 | 0 |
| amazon:2023 | kernel-tools-devel | 0 |
| amazon:2023 | kernel-libbpf-devel | 0 |
| amazon:2023 | kernel-tools | 0 |
| amazon:2023 | kernel-modules-extra-common | 0 |
| amazon:2023 | kernel-modules-extra | 0 |
| Linux | Linux | 6.9.7, 6cd4a78d962bebbaf8beb7d2ead3f34120e3f7b2, 5.15.162 |
| amazon:2023 | bpftool | 0 |
| amazon:2023 | perf | 0 |
| amazon:2023 | kernel-devel | 0 |
| amazon:2023 | kernel-libbpf-static | 0 |
Timeline
- Oct 31, 2024 CVE Published
- Nov 8, 2024 Coalition ESS Score (11 in total, the first dated here)
- Nov 9, 2024 EPSS Score (30 in total, the first dated here)
- Dec 16, 2025 PoC Published
- Jan 2, 2026 Security Advisory (189 in total, the first dated here)
- Jan 2, 2026 CVE Updated
- Mar 30, 2026 Distribution Patch (159 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2024-50186
vulnetix vdb fixes CVE-2024-50186
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-50186/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart