lkml.org 
[lkml]   [2022]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] kprobes: Fix build errors with CONFIG_KRETPROBES=n
On Tue, May 3, 2022 at 8:36 PM Masami Hiramatsu <mhiramat@kernel.org> wrote:
>
> 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.
>
> Reported-by: Max Filippov <jcmvbkbc@gmail.com>
> Fixes: d741bf41d7c7 ("kprobes: Remove kretprobe hash")
> Cc: stable@vger.kernel.org
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
> include/linux/kprobes.h | 2 -
> kernel/kprobes.c | 144 +++++++++++++++++++++++------------------------
> 2 files changed, 72 insertions(+), 74 deletions(-)

Tested-by: Max Filippov <jcmvbkbc@gmail.com>

--
Thanks.
-- Max

\
 
 \ /
  Last update: 2022-05-04 20:25    [W:0.136 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site