From: Greg Kroah-Hartman Date: Mon, 7 Nov 2022 09:30:06 +0000 (+0100) Subject: drop queue-6.0/bpf-return-value-in-kprobe-get_func_ip-only-for-entry-address.patch X-Git-Tag: v4.9.333~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c9ddf100bc36b4e0da2fa4d1922c03c0b72a469;p=thirdparty%2Fkernel%2Fstable-queue.git drop queue-6.0/bpf-return-value-in-kprobe-get_func_ip-only-for-entry-address.patch --- diff --git a/queue-6.0/bpf-return-value-in-kprobe-get_func_ip-only-for-entry-address.patch b/queue-6.0/bpf-return-value-in-kprobe-get_func_ip-only-for-entry-address.patch deleted file mode 100644 index 90974a8d62a..00000000000 --- a/queue-6.0/bpf-return-value-in-kprobe-get_func_ip-only-for-entry-address.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 0e253f7e558a3e250902ba2034091e0185448836 Mon Sep 17 00:00:00 2001 -From: Jiri Olsa -Date: Mon, 26 Sep 2022 17:33:39 +0200 -Subject: bpf: Return value in kprobe get_func_ip only for entry address - -From: Jiri Olsa - -commit 0e253f7e558a3e250902ba2034091e0185448836 upstream. - -Changing return value of kprobe's version of bpf_get_func_ip -to return zero if the attach address is not on the function's -entry point. - -For kprobes attached in the middle of the function we can't easily -get to the function address especially now with the CONFIG_X86_KERNEL_IBT -support. - -If user cares about current IP for kprobes attached within the -function body, they can get it with PT_REGS_IP(ctx). - -Suggested-by: Andrii Nakryiko -Acked-by: Andrii Nakryiko -Acked-by: Martynas Pumputis -Signed-off-by: Jiri Olsa -Link: https://lore.kernel.org/r/20220926153340.1621984-6-jolsa@kernel.org -Signed-off-by: Alexei Starovoitov -Cc: Jonas Rabenstein -Signed-off-by: Greg Kroah-Hartman ---- - include/uapi/linux/bpf.h | 1 + - kernel/trace/bpf_trace.c | 5 ++++- - tools/include/uapi/linux/bpf.h | 1 + - tools/testing/selftests/bpf/progs/get_func_ip_test.c | 4 ++-- - 4 files changed, 8 insertions(+), 3 deletions(-) - ---- a/include/uapi/linux/bpf.h -+++ b/include/uapi/linux/bpf.h -@@ -4922,6 +4922,7 @@ union bpf_attr { - * Get address of the traced function (for tracing and kprobe programs). - * Return - * Address of the traced function. -+ * 0 for kprobes placed within the function (not at the entry). - * - * u64 bpf_get_attach_cookie(void *ctx) - * Description ---- a/kernel/trace/bpf_trace.c -+++ b/kernel/trace/bpf_trace.c -@@ -1046,7 +1046,10 @@ BPF_CALL_1(bpf_get_func_ip_kprobe, struc - { - struct kprobe *kp = kprobe_running(); - -- return kp ? (uintptr_t)kp->addr : 0; -+ if (!kp || !(kp->flags & KPROBE_FLAG_ON_FUNC_ENTRY)) -+ return 0; -+ -+ return get_entry_ip((uintptr_t)kp->addr); - } - - static const struct bpf_func_proto bpf_get_func_ip_proto_kprobe = { ---- a/tools/include/uapi/linux/bpf.h -+++ b/tools/include/uapi/linux/bpf.h -@@ -4922,6 +4922,7 @@ union bpf_attr { - * Get address of the traced function (for tracing and kprobe programs). - * Return - * Address of the traced function. -+ * 0 for kprobes placed within the function (not at the entry). - * - * u64 bpf_get_attach_cookie(void *ctx) - * Description ---- a/tools/testing/selftests/bpf/progs/get_func_ip_test.c -+++ b/tools/testing/selftests/bpf/progs/get_func_ip_test.c -@@ -69,7 +69,7 @@ int test6(struct pt_regs *ctx) - { - __u64 addr = bpf_get_func_ip(ctx); - -- test6_result = (const void *) addr == &bpf_fentry_test6 + 5; -+ test6_result = (const void *) addr == 0; - return 0; - } - -@@ -79,6 +79,6 @@ int test7(struct pt_regs *ctx) - { - __u64 addr = bpf_get_func_ip(ctx); - -- test7_result = (const void *) addr == &bpf_fentry_test7 + 5; -+ test7_result = (const void *) addr == 0; - return 0; - } diff --git a/queue-6.0/series b/queue-6.0/series index 79482258e41..98bd850ae86 100644 --- a/queue-6.0/series +++ b/queue-6.0/series @@ -123,6 +123,5 @@ arm64-dts-juno-add-thermal-critical-trip-points.patch i2c-piix4-fix-adapter-not-be-removed-in-piix4_remove.patch bluetooth-l2cap-fix-accepting-connection-request-for-invalid-spsm.patch bluetooth-l2cap-fix-attempting-to-access-uninitialized-memory.patch -bpf-return-value-in-kprobe-get_func_ip-only-for-entry-address.patch fscrypt-stop-using-keyrings-subsystem-for-fscrypt_master_key.patch fscrypt-fix-keyring-memory-leak-on-mount-failure.patch