CVE-2024-26703 Information
Description
In the Linux kernel the following vulnerability has been resolved:
tracing/timerlat: Move hrtimer_init to timerlat_fd open()
Currently the timerlat’s hrtimer is initialized at the first read of timerlat_fd and destroyed at close(). It works but it causes an error if the user program open() and close() the file without reading.
Here’s an example:
echo NO_OSNOISE_WORKLOAD > /sys/kernel/debug/tracing/osnoise/options echo timerlat > /sys/kernel/debug/tracing/current_tracer
cat «EOF > ./timerlat_load.py !/usr/bin/env python3
timerlat_fd = open(/sys/kernel/tracing/osnoise/per_cpu/cpu0/timerlat_fd\ ‘r’) timerlat_fd.close(); EOF
./taskset -c 0 ./timerlat_load.py
BUG: kernel NULL pointer dereference address: 0000000000000010
PF: supervisor read access in kernel mode
PF: error_code(0x0000) - not-present page
PGD 0 P4D 0
Oops: 0000 [1] PREEMPT SMP NOPTI
CPU: 1 PID: 2673 Comm: python3 Not tainted 6.6.13-200.fc39.x86_64 1
Hardware name: QEMU Standard PC (Q35 + ICH9 2009) BIOS 1.16.3-1.fc39 04/01/2014
RIP: 0010:hrtimer_active+0xd/0x50
Code: 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 0f 1f 44 00 00 48 8b 57 30 <8b> 42 10 a8 01 74 09 f3 90 8b 42 10 a8 01 75 f7 80 7f 38 00 75 1d
RSP: 0018:ffffb031009b7e10 EFLAGS: 00010286
RAX: 000000000002db00 RBX: ffff9118f786db08 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff9117a0e64400 RDI: ffff9118f786db08
RBP: ffff9118f786db80 R08: ffff9117a0ddd420 R09: ffff9117804d4f70
R10: 0000000000000000 R11: 0000000000000000 R12: ffff9118f786db08
R13: ffff91178fdd5e20 R14: ffff9117840978c0 R15: 0000000000000000
FS: 00007f2ffbab1740(0000) GS:ffff9118f7840000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000010 CR3: 00000001b402e000 CR4: 0000000000750ee0
PKRU: 55555554
Call Trace:
Move hrtimer_init to timerlat_fd open() to avoid this problem.
Reference
https://git.kernel.org/stable/c/5f703935fdb559642d85b2088442ee55a557ae6d https://git.kernel.org/stable/c/2354d29986ebd138f89c2b73fecf8237e0a4ad6b https://git.kernel.org/stable/c/1389358bb008e7625942846e9f03554319b7fecc
Share on: