[RFC 0/2] arm64: kprobes: Fix single-step fault and reentry handling

Pu Hu hupu at transsion.com
Wed Jul 1 06:56:57 PDT 2026


On 7/1/2026 9:43 PM, Masami Hiramatsu wrote:
> On Wed, 1 Jul 2026 12:14:54 +0000
> Pu Hu <hupu at transsion.com> wrote:
> 
>> From: hupu <hupu at transsion.com>
>>
>> This series fixes two arm64 kprobes issues observed when running
>> simpleperf with preemptirq tracepoints and dwarf callchains while a
>> kprobe is active on a frequently executed kernel function.
>>
>> The crash happens in the kprobe debug exception path. While a kprobe is
>> preparing or executing its XOL single-step instruction, perf/trace code
>> can run in the same window. That code may either take a fault of its own
>> or hit another kprobe.
>>
>> Patch 1 makes kprobe_fault_handler() handle a fault in
>> KPROBE_HIT_SS/KPROBE_REENTER only when the faulting PC points at the
>> current kprobe's XOL instruction. Otherwise the fault is left to the
>> normal fault handling path.
>>
>> Patch 2 allows a kprobe hit in KPROBE_HIT_SS to be handled as a
>> recoverable one-level reentry. Only a hit while already in
>> KPROBE_REENTER remains unrecoverable.
>>
>> This follows the same logic as the existing x86 fixes:
>>    6381c24cd6d5 ("kprobes/x86: Fix page-fault handling logic")
>>    6a5022a56ac3 ("kprobes/x86: Allow to handle reentered kprobe on single-stepping")
> 
> Good catch!!
> The series looks good to me.
> 
> Acked-by: Masami Hiramatsu (Google) <mhiramat at kernel.org>
> 
> But it should be reviewed by arm64 maintainers too.
> 
> BTW, if you are "Pu Hu", the Signed-off-by tag should be
> "Pu Hu <...>" instead of "hupu <...>".
> 

Hi Masami,

Thank you for your reply and Acked-by.

Yes, thanks for pointing this out. I will fix the author name and the
Signed-off-by tags to use a consistent name in the next version of the
patchset.

Thanks,
hupu



More information about the linux-arm-kernel mailing list