CVE-2024-35886

Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
19/05/2024
Last modified:
23/12/2025

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> ipv6: Fix infinite recursion in fib6_dump_done().<br /> <br /> syzkaller reported infinite recursive calls of fib6_dump_done() during<br /> netlink socket destruction. [1]<br /> <br /> From the log, syzkaller sent an AF_UNSPEC RTM_GETROUTE message, and then<br /> the response was generated. The following recvmmsg() resumed the dump<br /> for IPv6, but the first call of inet6_dump_fib() failed at kzalloc() due<br /> to the fault injection. [0]<br /> <br /> 12:01:34 executing program 3:<br /> r0 = socket$nl_route(0x10, 0x3, 0x0)<br /> sendmsg$nl_route(r0, ... snip ...)<br /> recvmmsg(r0, ... snip ...) (fail_nth: 8)<br /> <br /> Here, fib6_dump_done() was set to nlk_sk(sk)-&gt;cb.done, and the next call<br /> of inet6_dump_fib() set it to nlk_sk(sk)-&gt;cb.args[3]. syzkaller stopped<br /> receiving the response halfway through, and finally netlink_sock_destruct()<br /> called nlk_sk(sk)-&gt;cb.done().<br /> <br /> fib6_dump_done() calls fib6_dump_end() and nlk_sk(sk)-&gt;cb.done() if it<br /> is still not NULL. fib6_dump_end() rewrites nlk_sk(sk)-&gt;cb.done() by<br /> nlk_sk(sk)-&gt;cb.args[3], but it has the same function, not NULL, calling<br /> itself recursively and hitting the stack guard page.<br /> <br /> To avoid the issue, let&amp;#39;s set the destructor after kzalloc().<br /> <br /> [0]:<br /> FAULT_INJECTION: forcing a failure.<br /> name failslab, interval 1, probability 0, space 0, times 0<br /> CPU: 1 PID: 432110 Comm: syz-executor.3 Not tainted 6.8.0-12821-g537c2e91d354-dirty #11<br /> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014<br /> Call Trace:<br /> <br /> dump_stack_lvl (lib/dump_stack.c:117)<br /> should_fail_ex (lib/fault-inject.c:52 lib/fault-inject.c:153)<br /> should_failslab (mm/slub.c:3733)<br /> kmalloc_trace (mm/slub.c:3748 mm/slub.c:3827 mm/slub.c:3992)<br /> inet6_dump_fib (./include/linux/slab.h:628 ./include/linux/slab.h:749 net/ipv6/ip6_fib.c:662)<br /> rtnl_dump_all (net/core/rtnetlink.c:4029)<br /> netlink_dump (net/netlink/af_netlink.c:2269)<br /> netlink_recvmsg (net/netlink/af_netlink.c:1988)<br /> ____sys_recvmsg (net/socket.c:1046 net/socket.c:2801)<br /> ___sys_recvmsg (net/socket.c:2846)<br /> do_recvmmsg (net/socket.c:2943)<br /> __x64_sys_recvmmsg (net/socket.c:3041 net/socket.c:3034 net/socket.c:3034)<br /> <br /> [1]:<br /> BUG: TASK stack guard page was hit at 00000000f2fa9af1 (stack is 00000000b7912430..000000009a436beb)<br /> stack guard page: 0000 [#1] PREEMPT SMP KASAN<br /> CPU: 1 PID: 223719 Comm: kworker/1:3 Not tainted 6.8.0-12821-g537c2e91d354-dirty #11<br /> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014<br /> Workqueue: events netlink_sock_destruct_work<br /> RIP: 0010:fib6_dump_done (net/ipv6/ip6_fib.c:570)<br /> Code: 3c 24 e8 f3 e9 51 fd e9 28 fd ff ff 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 f3 0f 1e fa 41 57 41 56 41 55 41 54 55 48 89 fd 48 8d 5d 60 e8 b6 4d 07 fd 48 89 da 48 b8 00 00 00 00 00 fc ff<br /> RSP: 0018:ffffc9000d980000 EFLAGS: 00010293<br /> RAX: 0000000000000000 RBX: ffffffff84405990 RCX: ffffffff844059d3<br /> RDX: ffff8881028e0000 RSI: ffffffff84405ac2 RDI: ffff88810c02f358<br /> RBP: ffff88810c02f358 R08: 0000000000000007 R09: 0000000000000000<br /> R10: 0000000000000000 R11: 0000000000000224 R12: 0000000000000000<br /> R13: ffff888007c82c78 R14: ffff888007c82c68 R15: ffff888007c82c68<br /> FS: 0000000000000000(0000) GS:ffff88811b100000(0000) knlGS:0000000000000000<br /> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033<br /> CR2: ffffc9000d97fff8 CR3: 0000000102309002 CR4: 0000000000770ef0<br /> PKRU: 55555554<br /> Call Trace:<br /> <br /> <br /> <br /> fib6_dump_done (net/ipv6/ip6_fib.c:572 (discriminator 1))<br /> fib6_dump_done (net/ipv6/ip6_fib.c:572 (discriminator 1))<br /> ...<br /> fib6_dump_done (net/ipv6/ip6_fib.c:572 (discriminator 1))<br /> fib6_dump_done (net/ipv6/ip6_fib.c:572 (discriminator 1))<br /> netlink_sock_destruct (net/netlink/af_netlink.c:401)<br /> __sk_destruct (net/core/sock.c:2177 (discriminator 2))<br /> sk_destruct (net/core/sock.c:2224)<br /> __sk_free (net/core/sock.c:2235)<br /> sk_free (net/core/sock.c:2246)<br /> process_one_work (kernel/workqueue.c:3259)<br /> worker_thread (kernel/workqueue.c:3329 kernel/workqueue.<br /> ---truncated---

Vulnerable products and versions

CPE From Up to
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 2.6.13 (including) 4.19.312 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 4.20 (including) 5.4.274 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.5 (including) 5.10.215 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.11 (including) 5.15.154 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.16 (including) 6.1.85 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.2 (including) 6.6.26 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.7 (including) 6.8.5 (excluding)
cpe:2.3:o:linux:linux_kernel:2.6.12:-:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:2.6.12:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:2.6.12:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:2.6.12:rc4:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:2.6.12:rc5:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.9:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.9:rc2:*:*:*:*:*:*
cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*