Skip to main content

CVE-2024-41004: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2024-41004cvecve-2024-41004
Published: Fri Jul 12 2024 (07/12/2024, 12:44:39 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: tracing: Build event generation tests only as modules The kprobes and synth event generation test modules add events and lock (get a reference) those event file reference in module init function, and unlock and delete it in module exit function. This is because those are designed for playing as modules. If we make those modules as built-in, those events are left locked in the kernel, and never be removed. This causes kprobe event self-test failure as below. [ 97.349708] ------------[ cut here ]------------ [ 97.353453] WARNING: CPU: 3 PID: 1 at kernel/trace/trace_kprobe.c:2133 kprobe_trace_self_tests_init+0x3f1/0x480 [ 97.357106] Modules linked in: [ 97.358488] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 6.9.0-g699646734ab5-dirty #14 [ 97.361556] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 [ 97.363880] RIP: 0010:kprobe_trace_self_tests_init+0x3f1/0x480 [ 97.365538] Code: a8 24 08 82 e9 ae fd ff ff 90 0f 0b 90 48 c7 c7 e5 aa 0b 82 e9 ee fc ff ff 90 0f 0b 90 48 c7 c7 2d 61 06 82 e9 8e fd ff ff 90 <0f> 0b 90 48 c7 c7 33 0b 0c 82 89 c6 e8 6e 03 1f ff 41 ff c7 e9 90 [ 97.370429] RSP: 0000:ffffc90000013b50 EFLAGS: 00010286 [ 97.371852] RAX: 00000000fffffff0 RBX: ffff888005919c00 RCX: 0000000000000000 [ 97.373829] RDX: ffff888003f40000 RSI: ffffffff8236a598 RDI: ffff888003f40a68 [ 97.375715] RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000 [ 97.377675] R10: ffffffff811c9ae5 R11: ffffffff8120c4e0 R12: 0000000000000000 [ 97.379591] R13: 0000000000000001 R14: 0000000000000015 R15: 0000000000000000 [ 97.381536] FS: 0000000000000000(0000) GS:ffff88807dcc0000(0000) knlGS:0000000000000000 [ 97.383813] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 97.385449] CR2: 0000000000000000 CR3: 0000000002244000 CR4: 00000000000006b0 [ 97.387347] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 97.389277] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 97.391196] Call Trace: [ 97.391967] <TASK> [ 97.392647] ? __warn+0xcc/0x180 [ 97.393640] ? kprobe_trace_self_tests_init+0x3f1/0x480 [ 97.395181] ? report_bug+0xbd/0x150 [ 97.396234] ? handle_bug+0x3e/0x60 [ 97.397311] ? exc_invalid_op+0x1a/0x50 [ 97.398434] ? asm_exc_invalid_op+0x1a/0x20 [ 97.399652] ? trace_kprobe_is_busy+0x20/0x20 [ 97.400904] ? tracing_reset_all_online_cpus+0x15/0x90 [ 97.402304] ? kprobe_trace_self_tests_init+0x3f1/0x480 [ 97.403773] ? init_kprobe_trace+0x50/0x50 [ 97.404972] do_one_initcall+0x112/0x240 [ 97.406113] do_initcall_level+0x95/0xb0 [ 97.407286] ? kernel_init+0x1a/0x1a0 [ 97.408401] do_initcalls+0x3f/0x70 [ 97.409452] kernel_init_freeable+0x16f/0x1e0 [ 97.410662] ? rest_init+0x1f0/0x1f0 [ 97.411738] kernel_init+0x1a/0x1a0 [ 97.412788] ret_from_fork+0x39/0x50 [ 97.413817] ? rest_init+0x1f0/0x1f0 [ 97.414844] ret_from_fork_asm+0x11/0x20 [ 97.416285] </TASK> [ 97.417134] irq event stamp: 13437323 [ 97.418376] hardirqs last enabled at (13437337): [<ffffffff8110bc0c>] console_unlock+0x11c/0x150 [ 97.421285] hardirqs last disabled at (13437370): [<ffffffff8110bbf1>] console_unlock+0x101/0x150 [ 97.423838] softirqs last enabled at (13437366): [<ffffffff8108e17f>] handle_softirqs+0x23f/0x2a0 [ 97.426450] softirqs last disabled at (13437393): [<ffffffff8108e346>] __irq_exit_rcu+0x66/0xd0 [ 97.428850] ---[ end trace 0000000000000000 ]--- And also, since we can not cleanup dynamic_event file, ftracetest are failed too. To avoid these issues, build these tests only as modules.

AI-Powered Analysis

AILast updated: 06/29/2025, 03:25:29 UTC

Technical Analysis

CVE-2024-41004 is a vulnerability in the Linux kernel related to the tracing subsystem, specifically concerning the kprobes and synthetic event generation test modules. These test modules are designed to be built and loaded as kernel modules. During their initialization, they add events and lock (reference) event files, and during module exit, they unlock and delete these event references. However, if these test modules are built directly into the kernel (built-in) rather than as loadable modules, the events remain locked indefinitely because the cleanup routines tied to module unloading are never executed. This results in the kprobe event self-test failing and triggers kernel warnings and errors, as evidenced by the provided kernel log trace. Additionally, the inability to clean up dynamic event files causes failures in ftracetest, another tracing test suite. The root cause is improper handling of event lifecycle when the test code is built-in, leading to resource locking and potential kernel instability during tracing operations. The fix involves ensuring these tests are only built as modules, preserving the expected load/unload lifecycle and proper cleanup of event references. This vulnerability does not appear to be exploitable for privilege escalation or remote code execution but can cause kernel warnings, test failures, and potentially impact kernel tracing reliability and stability.

Potential Impact

For European organizations relying on Linux systems, especially those using kernel tracing features for debugging, performance monitoring, or security auditing, this vulnerability can lead to degraded system reliability. The failure of kprobe self-tests and ftracetest may impair the ability to validate kernel tracing functionality, potentially hindering troubleshooting and forensic investigations. While this issue does not directly lead to a security breach or data compromise, it can cause kernel warnings and instability, which might affect critical systems that depend on accurate tracing data. Systems with built-in test modules rather than loadable ones are specifically affected, which may be the case in custom or embedded Linux distributions used in industrial control systems, telecommunications, or cloud infrastructure prevalent in Europe. The impact is primarily on system stability and diagnostic capabilities rather than confidentiality, integrity, or availability of data.

Mitigation Recommendations

1. Ensure that the kprobes and synthetic event generation tests are compiled and deployed only as loadable kernel modules, not built-in to the kernel image. This preserves the proper lifecycle management of event references. 2. Review and audit custom Linux kernel builds and distributions used within the organization to verify that these test modules are not built-in. 3. Apply the latest Linux kernel patches or updates that address this issue as soon as they become available. 4. For systems where kernel tracing is critical, implement monitoring to detect kernel warnings or errors related to kprobe or tracing subsystems, enabling early detection of this issue. 5. Avoid running kernel self-tests in production environments unless necessary, and if used, ensure they follow recommended build practices. 6. Collaborate with Linux distribution vendors to confirm that their kernels incorporate the fix and follow best practices for module building. 7. For embedded or specialized Linux systems, coordinate with device manufacturers to ensure updated kernel images are deployed.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-07-12T12:17:45.610Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9827c4522896dcbe162d

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

Last enriched: 6/29/2025, 3:25:29 AM

Last updated: 8/12/2025, 1:09:56 AM

Views: 12

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