CVE-2022-48839

Severity CVSS v4.0:
Pending analysis
Type:
CWE-125 Out-of-bounds Read
Publication date:
16/07/2024
Last modified:
18/07/2024

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> net/packet: fix slab-out-of-bounds access in packet_recvmsg()<br /> <br /> syzbot found that when an AF_PACKET socket is using PACKET_COPY_THRESH<br /> and mmap operations, tpacket_rcv() is queueing skbs with<br /> garbage in skb-&gt;cb[], triggering a too big copy [1]<br /> <br /> Presumably, users of af_packet using mmap() already gets correct<br /> metadata from the mapped buffer, we can simply make sure<br /> to clear 12 bytes that might be copied to user space later.<br /> <br /> BUG: KASAN: stack-out-of-bounds in memcpy include/linux/fortify-string.h:225 [inline]<br /> BUG: KASAN: stack-out-of-bounds in packet_recvmsg+0x56c/0x1150 net/packet/af_packet.c:3489<br /> Write of size 165 at addr ffffc9000385fb78 by task syz-executor233/3631<br /> <br /> CPU: 0 PID: 3631 Comm: syz-executor233 Not tainted 5.17.0-rc7-syzkaller-02396-g0b3660695e80 #0<br /> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011<br /> Call Trace:<br /> <br /> __dump_stack lib/dump_stack.c:88 [inline]<br /> dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106<br /> print_address_description.constprop.0.cold+0xf/0x336 mm/kasan/report.c:255<br /> __kasan_report mm/kasan/report.c:442 [inline]<br /> kasan_report.cold+0x83/0xdf mm/kasan/report.c:459<br /> check_region_inline mm/kasan/generic.c:183 [inline]<br /> kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189<br /> memcpy+0x39/0x60 mm/kasan/shadow.c:66<br /> memcpy include/linux/fortify-string.h:225 [inline]<br /> packet_recvmsg+0x56c/0x1150 net/packet/af_packet.c:3489<br /> sock_recvmsg_nosec net/socket.c:948 [inline]<br /> sock_recvmsg net/socket.c:966 [inline]<br /> sock_recvmsg net/socket.c:962 [inline]<br /> ____sys_recvmsg+0x2c4/0x600 net/socket.c:2632<br /> ___sys_recvmsg+0x127/0x200 net/socket.c:2674<br /> __sys_recvmsg+0xe2/0x1a0 net/socket.c:2704<br /> do_syscall_x64 arch/x86/entry/common.c:50 [inline]<br /> do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80<br /> entry_SYSCALL_64_after_hwframe+0x44/0xae<br /> RIP: 0033:0x7fdfd5954c29<br /> Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 15 00 00 90 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 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48<br /> RSP: 002b:00007ffcf8e71e48 EFLAGS: 00000246 ORIG_RAX: 000000000000002f<br /> RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fdfd5954c29<br /> RDX: 0000000000000000 RSI: 0000000020000500 RDI: 0000000000000005<br /> RBP: 0000000000000000 R08: 000000000000000d R09: 000000000000000d<br /> R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffcf8e71e60<br /> R13: 00000000000f4240 R14: 000000000000c1ff R15: 00007ffcf8e71e54<br /> <br /> <br /> addr ffffc9000385fb78 is located in stack of task syz-executor233/3631 at offset 32 in frame:<br /> ____sys_recvmsg+0x0/0x600 include/linux/uio.h:246<br /> <br /> this frame has 1 object:<br /> [32, 160) &amp;#39;addr&amp;#39;<br /> <br /> Memory state around the buggy address:<br /> ffffc9000385fa80: 00 04 f3 f3 f3 f3 f3 00 00 00 00 00 00 00 00 00<br /> ffffc9000385fb00: 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00<br /> &gt;ffffc9000385fb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f3<br /> ^<br /> ffffc9000385fc00: f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 f1<br /> ffffc9000385fc80: f1 f1 f1 00 f2 f2 f2 00 f2 f2 f2 00 00 00 00 00<br /> ==================================================================

Vulnerable products and versions

CPE From Up to
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 2.6.14 (including) 4.9.308 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 4.10 (including) 4.14.273 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 4.15 (including) 4.19.236 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 4.20 (including) 5.4.187 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.5 (including) 5.10.108 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.11 (including) 5.15.31 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.16 (including) 5.16.17 (excluding)