FAILED: patch "[PATCH] kprobes: Fix build errors with CONFIG_KRETPROBES=n" failed to apply to 5.15-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 43994049180704fd1faf78623fabd9a5cd443708 Mon Sep 17 00:00:00 2001
From: Masami Hiramatsu <[email protected]>
Date: Wed, 4 May 2022 12:36:31 +0900
Subject: [PATCH] kprobes: Fix build errors with CONFIG_KRETPROBES=n
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Max Filippov reported:
When building kernel with CONFIG_KRETPROBES=n kernel/kprobes.c compilation fails with the following messages:
kernel/kprobes.c: In function ‘recycle_rp_inst’:
kernel/kprobes.c:1273:32: error: implicit declaration of function
‘get_kretprobe’
kernel/kprobes.c: In function ‘kprobe_flush_task’:
kernel/kprobes.c:1299:35: error: ‘struct task_struct’ has no member
named ‘kretprobe_instances’
This came from the commit d741bf41d7c7 ("kprobes: Remove kretprobe hash") which introduced get_kretprobe() and kretprobe_instances member in task_struct when CONFIG_KRETPROBES=y, but did not make recycle_rp_inst() and kprobe_flush_task() depending on CONFIG_KRETPORBES.
Since those functions are only used for kretprobe, move those functions into #ifdef CONFIG_KRETPROBE area.
include/linux/kprobes.h +1 -1
@@ -424,7 +424,7 @@ void unregister_kretprobe(struct kretprobe *rp);int register_kretprobes (struct kretprobe **rps,int num);void unregister_kretprobes (struct kretprobe **rps,int num); -#ifdef CONFIG_KRETPROBE_ON_RETHOOK +#if defined(CONFIG_KRETPROBE_ON_RETHOOK ) || !defined(CONFIG_KRETPROBES )#define kprobe_flush_task (tk) do {} while (0)#else void kprobe_flush_task (struct task_struct *tk);
kernel/kprobes.c +71 -73
156 lines not on this page · raw message