From: Greg Kroah-Hartman Date: Tue, 29 Sep 2020 06:55:14 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v4.4.238~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d895d2ebf6bc7a8b1b3fa3930c594653212413a9;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: kprobes-fix-compiler-warning-for-config_kprobes_on_ftrace.patch --- diff --git a/queue-4.19/kprobes-fix-compiler-warning-for-config_kprobes_on_ftrace.patch b/queue-4.19/kprobes-fix-compiler-warning-for-config_kprobes_on_ftrace.patch new file mode 100644 index 00000000000..68d4460f8f4 --- /dev/null +++ b/queue-4.19/kprobes-fix-compiler-warning-for-config_kprobes_on_ftrace.patch @@ -0,0 +1,61 @@ +From 10de795a5addd1962406796a6e13ba6cc0fc6bee Mon Sep 17 00:00:00 2001 +From: Muchun Song +Date: Thu, 6 Aug 2020 01:20:46 +0800 +Subject: kprobes: Fix compiler warning for !CONFIG_KPROBES_ON_FTRACE + +From: Muchun Song + +commit 10de795a5addd1962406796a6e13ba6cc0fc6bee upstream. + +Fix compiler warning(as show below) for !CONFIG_KPROBES_ON_FTRACE. + +kernel/kprobes.c: In function 'kill_kprobe': +kernel/kprobes.c:1116:33: warning: statement with no effect +[-Wunused-value] + 1116 | #define disarm_kprobe_ftrace(p) (-ENODEV) + | ^ +kernel/kprobes.c:2154:3: note: in expansion of macro +'disarm_kprobe_ftrace' + 2154 | disarm_kprobe_ftrace(p); + +Link: https://lore.kernel.org/r/20200805142136.0331f7ea@canb.auug.org.au +Link: https://lkml.kernel.org/r/20200805172046.19066-1-songmuchun@bytedance.com + +Reported-by: Stephen Rothwell +Fixes: 0cb2f1372baa ("kprobes: Fix NULL pointer dereference at kprobe_ftrace_handler") +Acked-by: Masami Hiramatsu +Acked-by: John Fastabend +Signed-off-by: Muchun Song +Signed-off-by: Steven Rostedt (VMware) +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/kprobes.c | 17 ++++++++++++++--- + 1 file changed, 14 insertions(+), 3 deletions(-) + +--- a/kernel/kprobes.c ++++ b/kernel/kprobes.c +@@ -1065,9 +1065,20 @@ static int disarm_kprobe_ftrace(struct k + return ret; + } + #else /* !CONFIG_KPROBES_ON_FTRACE */ +-#define prepare_kprobe(p) arch_prepare_kprobe(p) +-#define arm_kprobe_ftrace(p) (-ENODEV) +-#define disarm_kprobe_ftrace(p) (-ENODEV) ++static inline int prepare_kprobe(struct kprobe *p) ++{ ++ return arch_prepare_kprobe(p); ++} ++ ++static inline int arm_kprobe_ftrace(struct kprobe *p) ++{ ++ return -ENODEV; ++} ++ ++static inline int disarm_kprobe_ftrace(struct kprobe *p) ++{ ++ return -ENODEV; ++} + #endif + + /* Arm a kprobe with text_mutex */ diff --git a/queue-4.19/series b/queue-4.19/series index 926b526a1df..8818751b57e 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -239,3 +239,4 @@ kprobes-fix-to-check-probe-enabled-before-disarm_kprobe_ftrace.patch mm-thp-swap-fix-allocating-cluster-for-swapfile-by-mistake.patch s390-zcrypt-fix-zcrypt_perdev_reqcnt-ioctl.patch kvm-arm64-assume-write-fault-on-s1ptw-permission-fault-on-instruction-fetch.patch +kprobes-fix-compiler-warning-for-config_kprobes_on_ftrace.patch