kprobes: don't call disarm_kprobe() for disabled kprobes
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 69d54b916d83872a0a327778a01af2a096923f59 · < 55c7a91527343d2e0b5647cc308c6e04ddd2aa52| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
kprobes: don't call disarm_kprobe() for disabled kprobes
The assumption in __disable_kprobe() is wrong, and it could try to disarm an already disarmed kprobe and fire the WARN_ONCE() below. [0] We can easily reproduce this issue.
1. Write 0 to /sys/kernel/debug/kprobes/enabled.
# echo 0 > /sys/kernel/debug/kprobes/enabled
2. Run execsnoop. At this time, one kprobe is disabled.
# /usr/share/bcc/tools/execsnoop & [1] 2460 PCOMM PID PPID RET ARGS
# cat /sys/kernel/debug/kprobes/list ffffffff91345650 r __x64_sys_execve+0x0 [FTRACE] ffffffff91345650 k __x64_sys_execve+0x0 [DISABLED][FTRACE]
From the CVE record · Linux
The Linux kernel’s kprobes code can try to disarm a probe that is already disabled, leaving an aggregated probe in an invalid state. A local user who can change the kprobes enabled setting and run a tracing tool can trigger an infinite loop, causing an RCU stall or soft lockup.
Engineers running Linux kernels with kprobes enabled should check their kernel against the vendor advisory; affected versions are not specified in the input.