Bugzilla – Bug 1112859
VUL-0: CVE-2018-18559: kernel-source: Use-after-free due to race condition in AF_PACKET implementation
Last modified: 2024-07-04 09:13:48 UTC
In the Linux kernel through 4.19, a use-after-free can occur due to a race condition between fanout_add from setsockopt and bind on an AF_PACKET socket. This issue exists because of the 15fe076edea787807a7cdc168df832544b58eba6 incomplete fix for a race condition. The code mishandles a certain multithreaded case involving a packet_do_bind unregister action followed by a packet_notifier register action. Later, packet_release operates on only one of the two applicable linked lists. The attacker can achieve Program Counter control. External Reference: https://blogs.securiteam.com/index.php/archives/3731 References: https://bugzilla.redhat.com/show_bug.cgi?id=1641878 http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2018-18559
Based on the description, affected branches should be those where commit 15fe076edea7 was needed, i.e. 4.4 based and newer. This race started with mainline commit 30f7ea1c2b5f ("packet: race condition in packet_bind") which wasn't backported to any of our older branches. There is no fix in net tree yet, AFAICS, or submitted to netdev mailing list. I'll take a closer look at the code later today.
30f7ea1c2b5f would be 4.4 15fe076edea7 being the fix would be 4.15 so 4.4 -> 4.15 affected
sle15 and sle12sp4: patches.fixes/net-packet-fix-a-race-in-packet_bind-and-packet_noti.patch SLE12 SP2 and SP3: patches.kernel.org/4.4.106-100-net-packet-fix-a-race-in-packet_bind-and-pack.patch:Git-commit: 15fe076edea787807a7cdc168df832544b58eba6 patches.kernel.org/4.4.106-100-net-packet-fix-a-race-in-packet_bind-and-pack.patch:[ Upstream commit 15fe076edea787807a7cdc168df832544b58eba6 ]
I'm not sure. I must admit I had also trouble understanding the race condition described in the article but I wasn't sure if it's me or if the claim is not correct. Based on the claim that "The vulnerability has been resolved in the latest Linux Kernel version 4.17.11", I also checked mainline commit 945d015ee0c3 net/packet: fix use-after-free (v4.18-rc3) which has been backported into 4.17.9 (there is nothing remotely related between 4.17.10 and 4.17.11) but it doesn't seem to match their description either.
for SLE15 and SLES 12 SP4 this was included in GA.
Done.
Closing.