Skip to main content

CVE-2024-56368: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-56368cvecve-2024-56368
Published: Sat Jan 11 2025 (01/11/2025, 12:35:45 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: ring-buffer: Fix overflow in __rb_map_vma An overflow occurred when performing the following calculation: nr_pages = ((nr_subbufs + 1) << subbuf_order) - pgoff; Add a check before the calculation to avoid this problem. syzbot reported this as a slab-out-of-bounds in __rb_map_vma: BUG: KASAN: slab-out-of-bounds in __rb_map_vma+0x9ab/0xae0 kernel/trace/ring_buffer.c:7058 Read of size 8 at addr ffff8880767dd2b8 by task syz-executor187/5836 CPU: 0 UID: 0 PID: 5836 Comm: syz-executor187 Not tainted 6.13.0-rc2-syzkaller-00159-gf932fb9b4074 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2024 Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 __rb_map_vma+0x9ab/0xae0 kernel/trace/ring_buffer.c:7058 ring_buffer_map+0x56e/0x9b0 kernel/trace/ring_buffer.c:7138 tracing_buffers_mmap+0xa6/0x120 kernel/trace/trace.c:8482 call_mmap include/linux/fs.h:2183 [inline] mmap_file mm/internal.h:124 [inline] __mmap_new_file_vma mm/vma.c:2291 [inline] __mmap_new_vma mm/vma.c:2355 [inline] __mmap_region+0x1786/0x2670 mm/vma.c:2456 mmap_region+0x127/0x320 mm/mmap.c:1348 do_mmap+0xc00/0xfc0 mm/mmap.c:496 vm_mmap_pgoff+0x1ba/0x360 mm/util.c:580 ksys_mmap_pgoff+0x32c/0x5c0 mm/mmap.c:542 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:82 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:82 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The reproducer for this bug is: ------------------------8<------------------------- #include <fcntl.h> #include <stdlib.h> #include <unistd.h> #include <asm/types.h> #include <sys/mman.h> int main(int argc, char **argv) { int page_size = getpagesize(); int fd; void *meta; system("echo 1 > /sys/kernel/tracing/buffer_size_kb"); fd = open("/sys/kernel/tracing/per_cpu/cpu0/trace_pipe_raw", O_RDONLY); meta = mmap(NULL, page_size, PROT_READ, MAP_SHARED, fd, page_size * 5); } ------------------------>8-------------------------

AI-Powered Analysis

AILast updated: 06/28/2025, 11:25:51 UTC

Technical Analysis

CVE-2024-56368 is a vulnerability identified in the Linux kernel's ring buffer implementation, specifically within the __rb_map_vma function located in kernel/trace/ring_buffer.c. The flaw arises due to an integer overflow during the calculation of the number of pages (nr_pages) used for memory mapping of tracing buffers. The calculation in question is nr_pages = ((nr_subbufs + 1) << subbuf_order) - pgoff. Without proper bounds checking, this calculation can overflow, leading to an incorrect, smaller value for nr_pages. This results in a slab-out-of-bounds read, as the kernel attempts to access memory beyond the allocated buffer, triggering a KASAN (Kernel Address Sanitizer) error. The vulnerability was discovered and reported by syzbot, an automated kernel fuzzing tool, which detected a slab-out-of-bounds read during the execution of a test case involving mmap on the tracing buffer. The vulnerability affects Linux kernel version 6.13.0-rc2 and likely other versions with similar ring buffer code. The root cause is a missing check before the calculation to prevent overflow, which has been fixed in the patched kernel. Exploiting this vulnerability requires the ability to open and mmap the tracing buffer files under /sys/kernel/tracing, which typically requires elevated privileges or specific capabilities. The provided reproducer code demonstrates how an attacker or tester can trigger the overflow by opening the trace_pipe_raw file and performing an mmap with carefully chosen parameters. While no known exploits are currently reported in the wild, the vulnerability could potentially be leveraged for local privilege escalation or denial of service by causing kernel memory corruption or crashes. The flaw impacts kernel tracing infrastructure, which is used for debugging and performance monitoring, and thus may affect systems where tracing is enabled or accessible. The vulnerability does not have an assigned CVSS score yet, and no official patch links are provided in the data, but it is marked as resolved in recent kernel revisions.

Potential Impact

For European organizations, the impact of CVE-2024-56368 depends largely on their use of Linux systems with kernel tracing enabled and accessible to unprivileged or semi-privileged users. Many enterprises, cloud providers, and data centers across Europe run Linux-based servers, often with kernel tracing enabled for diagnostics or performance monitoring. If an attacker gains local access to a vulnerable system, they could exploit this vulnerability to cause kernel memory corruption, leading to system instability, crashes (denial of service), or potentially escalate privileges to gain root access. This poses a significant risk to critical infrastructure, cloud services, and enterprise IT environments that rely on Linux servers. The vulnerability is particularly relevant for organizations that allow developers or users access to tracing interfaces or have containerized environments where capabilities might be misconfigured. Given the widespread use of Linux in European government, finance, telecommunications, and industrial sectors, exploitation could disrupt services, compromise data confidentiality and integrity, and impact availability. However, exploitation requires local access and some level of permissions, limiting remote attack vectors. The absence of known exploits in the wild suggests that immediate widespread attacks are unlikely, but the vulnerability should be treated seriously due to its kernel-level impact and potential for privilege escalation.

Mitigation Recommendations

To mitigate CVE-2024-56368, European organizations should: 1) Update Linux kernels to the latest stable versions where the overflow check in __rb_map_vma has been implemented and the vulnerability resolved. Monitoring kernel release notes and applying security patches promptly is critical. 2) Restrict access to kernel tracing interfaces under /sys/kernel/tracing, ensuring only trusted administrators have permissions to open and mmap these files. Use strict file system permissions and Linux capabilities to limit exposure. 3) Audit container and virtualization environments to verify that tracing capabilities are not inadvertently exposed to unprivileged containers or users. 4) Employ kernel hardening features such as Kernel Address Sanitizer (KASAN) in testing environments to detect similar memory issues proactively. 5) Monitor system logs and kernel messages for unusual crashes or KASAN reports that may indicate exploitation attempts. 6) Implement robust local access controls and user privilege management to reduce the risk of local attackers exploiting this vulnerability. 7) Consider disabling kernel tracing features if not required for production systems, reducing the attack surface. These steps go beyond generic advice by focusing on controlling access to the vulnerable interface and ensuring timely patching.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-01-09T09:49:29.671Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9823c4522896dcbdf12b

Added to database: 5/21/2025, 9:08:51 AM

Last enriched: 6/28/2025, 11:25:51 AM

Last updated: 8/6/2025, 11:12:13 PM

Views: 15

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