kprobes: Fix check for probe enabled in kill_kprobe()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
kprobes: Fix check for probe enabled in kill_kprobe()
In kill_kprobe(), the check whether disarm_kprobe_ftrace() needs to be called always fails. This is because before that we set the KPROBE_FLAG_GONE flag for kprobe so that "!kprobe_disabled(p)" is always false.
The disarm_kprobe_ftrace() call introduced by commit:
0cb2f1372baa ("kprobes: Fix NULL pointer dereference at kprobe_ftrace_handler")
to fix the NULL pointer reference problem. When the probe is enabled, if we do not disarm it, this problem still exists.
Fix it by putting the probe enabled check before setting the KPROBE_FLAG_GONE flag.
From the CVE record · Linux
The Linux kernel's kprobes code can fail to disarm an enabled probe because it checks the probe's state after marking it gone. This leaves a NULL pointer dereference possible when the probe is enabled. The input does not specify an attack path, authentication requirement, or user interaction.
Engineers running Linux kernels with kprobes should check whether their kernel is affected; affected versions are not specified.