kprobes: Skip disarmed probes when checking optkprobe overlap
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ afd66255b9a48f5851326ddae50e2203fbf71dc9 · < 6745fa65f4115045431c0c15610e876855a04625| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
kprobes: Skip disarmed probes when checking optkprobe overlap
On x86, an optkprobe at A replaces five bytes with a jump. If a disabled probe B is at A+2, get_optimized_kprobe() stops at B when arming a new probe C at A+4. It leaves A optimized:
A A+1 A+2 A+3 A+4 A's jump | e9 | d0 | d1 | d2 | d3 | after C | e9 | d0 | d1 | d2 | cc |
The INT3 for C overwrites the last byte of A's jump displacement, so execution can jump to the wrong address. B can have prepared optinsns while disarmed, but has no jump to unoptimize.
Continue past disarmed and unprepared probes to find the active optimized probe before arming a probe in its jump.
From the CVE record · Linux
On x86, Linux kernel kprobes can miss an active optimized probe when a disarmed probe lies between it and a newly armed probe. The new probe can overwrite part of the optimized probe’s jump, causing execution to jump to the wrong address. The input does not specify an attack vector, authentication requirement, or user interaction.
Engineers running Linux kernels that use x86 kprobes should check their versions against the vendor advisory; affected versions are not specified.