Skip to main content

CVE-2022-48839: Vulnerability in Linux Linux

High
VulnerabilityCVE-2022-48839cvecve-2022-48839
Published: Tue Jul 16 2024 (07/16/2024, 12:25:10 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

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

AI-Powered Analysis

AILast updated: 06/30/2025, 22:39:36 UTC

Technical Analysis

CVE-2022-48839 is a vulnerability in the Linux kernel's networking subsystem, specifically within the AF_PACKET socket implementation. The flaw arises in the packet_recvmsg() function, which handles receiving messages on AF_PACKET sockets using PACKET_COPY_THRESH and mmap operations. The issue was discovered by syzbot, an automated kernel fuzzer, which identified a slab-out-of-bounds access caused by tpacket_rcv() queueing socket buffers (skbs) containing uninitialized or garbage data in the skb->cb[] control buffer. This leads to an out-of-bounds memory copy when packet_recvmsg() attempts to copy this data to user space, triggering a stack-out-of-bounds write detected by Kernel Address Sanitizer (KASAN). The root cause is that 12 bytes of metadata in the skb->cb[] buffer are not properly cleared before being copied, which can result in leaking kernel stack data or corrupting memory. The vulnerability affects Linux kernel versions prior to the patch that ensures these bytes are zeroed out before copying. The flaw is triggered when applications use AF_PACKET sockets with PACKET_COPY_THRESH and mmap, a relatively specialized use case often employed in high-performance packet capture or network monitoring tools. The kernel call stack and memory dump indicate the vulnerability manifests during the recvmsg syscall path, with no direct indication of privilege escalation but a potential for information disclosure or memory corruption. No known exploits are currently reported in the wild, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, the impact of CVE-2022-48839 depends on their use of Linux systems running vulnerable kernel versions and employing AF_PACKET sockets with PACKET_COPY_THRESH and mmap. This vulnerability could lead to kernel memory corruption or leakage of sensitive kernel stack data, potentially undermining system confidentiality and stability. Organizations relying on Linux-based network appliances, intrusion detection systems, or custom packet capture solutions may be at higher risk. Exploitation could allow attackers with local user access to cause denial of service via kernel crashes or possibly gain further foothold by corrupting kernel memory. Given the widespread use of Linux in European data centers, cloud infrastructure, and embedded systems, the vulnerability poses a moderate risk, especially in environments where untrusted users have shell access or can run code. However, the specialized nature of the attack vector and lack of remote exploitability limit the threat primarily to local privilege escalation or information disclosure scenarios.

Mitigation Recommendations

European organizations should prioritize patching Linux kernels to versions that include the fix for CVE-2022-48839, ensuring that the skb->cb[] buffer is properly cleared before copying to user space. Since the vulnerability involves AF_PACKET sockets with PACKET_COPY_THRESH and mmap, organizations should audit their systems for applications or services using these features and restrict or monitor their usage. Employing kernel hardening techniques such as Kernel Address Sanitizer (KASAN) in testing environments can help detect similar issues early. Additionally, enforcing strict access controls to limit local user privileges and using containerization or sandboxing to isolate untrusted code can reduce exploitation risk. Network monitoring should be enhanced to detect anomalous use of AF_PACKET sockets or suspicious packet capture activity. Finally, organizations should maintain up-to-date inventories of Linux kernel versions deployed across their infrastructure to ensure timely patch management.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-07-16T11:38:08.909Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d982ec4522896dcbe6326

Added to database: 5/21/2025, 9:09:02 AM

Last enriched: 6/30/2025, 10:39:36 PM

Last updated: 8/3/2025, 1:00:27 PM

Views: 10

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats