]> git.itanic.dy.fi Git - linux-stable/commit
fprobe: add recursion detection in fprobe_exit_handler
authorZe Gao <zegao2021@gmail.com>
Wed, 17 May 2023 03:45:08 +0000 (11:45 +0800)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Wed, 17 May 2023 22:08:01 +0000 (07:08 +0900)
commit2752741080f84f9b2fc93fa92735315d10a415bf
tree56511a45fad7d44e6147ceffb87052ffe1f85ecc
parent3cc4e2c5fbae84e5033723fb7e350bc6c164e3a2
fprobe: add recursion detection in fprobe_exit_handler

fprobe_hander and fprobe_kprobe_handler has guarded ftrace recursion
detection but fprobe_exit_handler has not, which possibly introduce
recursive calls if the fprobe exit callback calls any traceable
functions. Checking in fprobe_hander or fprobe_kprobe_handler
is not enough and misses this case.

So add recursion free guard the same way as fprobe_hander. Since
ftrace recursion check does not employ ip(s), so here use entry_ip and
entry_parent_ip the same as fprobe_handler.

Link: https://lore.kernel.org/all/20230517034510.15639-4-zegao@tencent.com/
Fixes: 5b0ab78998e3 ("fprobe: Add exit_handler support")
Signed-off-by: Ze Gao <zegao@tencent.com>
Cc: stable@vger.kernel.org
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
kernel/trace/fprobe.c