2023-05-16 07:54:02

by Ze Gao

[permalink] [raw]
Subject: [PATCH v2 0/4] Make fprobe + rethook immune to recursion

Hi all,

This is the 2nd version of patch series to fix the ftrace rethook recursion problem.

v1: https://lore.kernel.org/linux-trace-kernel/[email protected]/T/ +++#md4c0bae6a6cae28dadf2a2c6105ff140b35fddea

As Steven suggested, this version removes unnecessary notrace annotations from fprobe
and rethook functions from v1 [PATCH 2,3,4/4] and replaces with makefile changes to filter
out compiler flags which ftrace depends upon for rethook related objects.

Ze Gao (4):
rethook: use preempt_{disable, enable}_notrace in
rethook_trampoline_handler
fprobe: make fprobe_kprobe_handler recursion free
fprobe: add recursion detection in fprobe_exit_handler
rehook, fprobe: do not trace rethook related functions

arch/riscv/kernel/probes/Makefile | 2 +
arch/s390/kernel/Makefile | 1 +
arch/x86/kernel/Makefile | 1 +
kernel/trace/fprobe.c | 72 ++++++++++++++++++++++++-------
kernel/trace/rethook.c | 4 +-
5 files changed, 63 insertions(+), 17 deletions(-)

--
2.40.1



2023-05-16 22:13:36

by Jiri Olsa

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] Make fprobe + rethook immune to recursion

On Tue, May 16, 2023 at 03:18:26PM +0800, Ze Gao wrote:
> Hi all,
>
> This is the 2nd version of patch series to fix the ftrace rethook recursion problem.
>
> v1: https://lore.kernel.org/linux-trace-kernel/[email protected]/T/ +++#md4c0bae6a6cae28dadf2a2c6105ff140b35fddea
>
> As Steven suggested, this version removes unnecessary notrace annotations from fprobe
> and rethook functions from v1 [PATCH 2,3,4/4] and replaces with makefile changes to filter
> out compiler flags which ftrace depends upon for rethook related objects.
>
> Ze Gao (4):
> rethook: use preempt_{disable, enable}_notrace in
> rethook_trampoline_handler
> fprobe: make fprobe_kprobe_handler recursion free
> fprobe: add recursion detection in fprobe_exit_handler
> rehook, fprobe: do not trace rethook related functions

hi,
what tree is this based on? I have troubles to apply that

thanks,
jirka

>
> arch/riscv/kernel/probes/Makefile | 2 +
> arch/s390/kernel/Makefile | 1 +
> arch/x86/kernel/Makefile | 1 +
> kernel/trace/fprobe.c | 72 ++++++++++++++++++++++++-------
> kernel/trace/rethook.c | 4 +-
> 5 files changed, 63 insertions(+), 17 deletions(-)
>
> --
> 2.40.1
>