Vulnerability · Published Oct 21, 2024 · Assigned by Linux
CVE-2024-47711af_unix: Don't return OOB skb in manage_oob().
High 7.8
In plain English
A high-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 11% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: af_unix: Don't return OOB skb in manage_oob(). syzbot reported use-after-free in unix_stream_recv_urg(). [0] The scenario is 1. send(MSG_OOB) 2. recv(MSG_OOB) -> The consumed OOB remains in recv queue 3. send(MSG_OOB) 4. recv() -> manage_oob() returns the next skb of the consumed OOB -> This is also OOB, but unix_sk(sk)->oob_skb is not cleared 5. recv(MSG_OOB) -> unix_sk(sk)->oob_skb is used but already freed The recent commit 8594d9b85c07 ("af_unix: Don't call skb_get() for OOB skb.") uncovered the issue. If the OOB skb is consumed and the next skb is peeked in manage_oob(), we still need to check if the skb is OOB. Let's do so by falling back to the following checks in manage_oob() and add the test case in selftest. Note that we need to add a similar check for SIOCATMARK. [0]: BUG: KASAN: slab-use-after-free in unix_stream_read_actor+0xa6/0xb0 net/unix/af_unix.c:2959 Read of size 4 at addr ffff8880326abcc4 by task syz-executor178/5235 CPU: 0 UID: 0 PID: 5235 Comm: syz-executor178 Not tainted 6.11.0-rc5-syzkaller-00742-gfbdaffe41adc #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: <TASK> __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 unix_stream_read_actor+0xa6/0xb0 net/unix/af_unix.c:2959 unix_stream_recv_urg+0x1df/0x320 net/unix/af_unix.c:2640 unix_stream_read_generic+0x2456/0x2520 net/unix/af_unix.c:2778 unix_stream_recvmsg+0x22b/0x2c0 net/unix/af_unix.c:2996 sock_recvmsg_nosec net/socket.c:1046 [inline] sock_recvmsg+0x22f/0x280 net/socket.c:1068 ____sys_recvmsg+0x1db/0x470 net/socket.c:2816 ___sys_recvmsg net/socket.c:2858 [inline] __sys_recvmsg+0x2f0/0x3e0 net/socket.c:2888 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f5360d6b4e9 Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fff29b3a458 EFLAGS: 00000246 ORIG_RAX: 000000000000002f RAX: ffffffffffffffda RBX: 00007fff29b3a638 RCX: 00007f5360d6b4e9 RDX: 0000000000002001 RSI: 0000000020000640 RDI: 0000000000000003 RBP: 00007f5360dde610 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fff29b3a628 R14: 0000000000000001 R15: 0000000000000001 </TASK> Allocated by task 5235: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3988 [inline] slab_alloc_node mm/slub.c:4037 [inline] kmem_cache_alloc_node_noprof+0x16b/0x320 mm/slub.c:4080 __alloc_skb+0x1c3/0x440 net/core/skbuff.c:667 alloc_skb include/linux/skbuff.h:1320 [inline] alloc_skb_with_frags+0xc3/0x770 net/core/skbuff.c:6528 sock_alloc_send_pskb+0x91a/0xa60 net/core/sock.c:2815 sock_alloc_send_skb include/net/sock.h:1778 [inline] queue_oob+0x108/0x680 net/unix/af_unix.c:2198 unix_stream_sendmsg+0xd24/0xf80 net/unix/af_unix.c:2351 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 ____sys_sendmsg+0x525/0x7d0 net/socket.c:2597 ___sys_sendmsg net/socket.c:2651 [inline] __sys_sendmsg+0x2b0/0x3a0 net/socket.c:2680 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5235: kasan_save_stack mm/kasan/common.c:47 ---truncated---
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:13 | linux | 6.11.2-1 | DEBIAN-CVE-2024-47711 |
| Debian:14 | linux | 6.11.2-1 | DEBIAN-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux | 6.8.0-56.58 | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux | 6.8.0-56.58 | USN-7383-1 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1025.27 | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1025.27 | USN-7383-1 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1027.29~22.04.1 | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1027.29~22.04.1 | USN-7451-1 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1025.30 | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1025.30 | USN-7384-1 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-azure-6.11 | 6.11.0-1012.12~24.04.1 | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1025.30~22.04.1 | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1025.30~22.04.1 | USN-7384-2 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-azure-nvidia | 6.8.0-1014.15 | USN-7468-1 |
| Ubuntu:24.04:LTS | linux-azure-nvidia | 6.8.0-1014.15 | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1026.28 | USN-7383-1 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1026.28 | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-gcp-6.11 | 6.11.0-1011.11~24.04.1 | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1026.28~22.04.1 | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1026.28~22.04.1 | USN-7383-1 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1021.25 | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1021.25 | USN-7383-1 |
| Ubuntu:24.04:LTS | linux-gkeop | 6.8.0-1008.10 | USN-7383-1 |
| Ubuntu:24.04:LTS | linux-gkeop | 6.8.0-1008.10 | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 6.8.0-57.59~22.04.1 | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 6.8.0-57.59~22.04.1 | USN-7403-1 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1022.22 | USN-7385-1 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1022.22 | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-ibm-6.8 | 6.8.0-1023.23~22.04.1 | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-56.58.1 | USN-7383-1 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-56.58.1 | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-56.58.1~22.04.1 | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-56.58.1~22.04.1 | USN-7383-1 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1024.27 | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1024.27 | USN-7383-1 |
| Ubuntu:24.04:LTS | linux-nvidia-6.11 | 6.11.0-1007.7 | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1024.27~22.04.1 | USN-7383-1 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1024.27~22.04.1 | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 6.8.0-1024.27.1 | USN-7383-1 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 6.8.0-1024.27.1 | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-nvidia-tegra | 6.8.0-1004.4 | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-oem-6.11 | 6.11.0-1015.15 | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-oem-6.11 | 6.11.0-1015.15 | USN-7310-1 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 6.8.0-1024.24 | USN-7386-1 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 6.8.0-1024.24 | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1022.23 | USN-7383-1 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1022.23 | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1022.23~22.04.1 | USN-7383-1 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1022.23~22.04.1 | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1028.32 | USN-7524-1 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1028.32 | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-riscv | 6.8.0-56.58.1 | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-riscv-6.8 | 6.8.0-56.58.1~22.04.1 | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2024-47711 |
| Ubuntu:24.04:LTS | linux-xilinx | 6.8.0-1017.18 | UBUNTU-CVE-2024-47711 |