From 74b8e88a17fd1a136eae79e3aa1feabd085d0ea4 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 28 Oct 2024 07:18:41 +0100 Subject: [PATCH] 5.4-stable patches added patches: arm64-uprobes-change-the-uprobe_opcode_t-typedef-to-fix-the-sparse-warning.patch --- ..._t-typedef-to-fix-the-sparse-warning.patch | 46 +++++++++++++++++++ queue-5.4/series | 1 + 2 files changed, 47 insertions(+) create mode 100644 queue-5.4/arm64-uprobes-change-the-uprobe_opcode_t-typedef-to-fix-the-sparse-warning.patch diff --git a/queue-5.4/arm64-uprobes-change-the-uprobe_opcode_t-typedef-to-fix-the-sparse-warning.patch b/queue-5.4/arm64-uprobes-change-the-uprobe_opcode_t-typedef-to-fix-the-sparse-warning.patch new file mode 100644 index 00000000000..8a31cbd3284 --- /dev/null +++ b/queue-5.4/arm64-uprobes-change-the-uprobe_opcode_t-typedef-to-fix-the-sparse-warning.patch @@ -0,0 +1,46 @@ +From ef08c0fadd8a17ebe429b85e23952dac3263ad34 Mon Sep 17 00:00:00 2001 +From: junhua huang +Date: Wed, 28 Dec 2022 09:54:12 +0800 +Subject: arm64/uprobes: change the uprobe_opcode_t typedef to fix the sparse warning + +From: junhua huang + +commit ef08c0fadd8a17ebe429b85e23952dac3263ad34 upstream. + +After we fixed the uprobe inst endian in aarch_be, the sparse check report +the following warning info: + +sparse warnings: (new ones prefixed by >>) +>> kernel/events/uprobes.c:223:25: sparse: sparse: restricted __le32 degrades to integer +>> kernel/events/uprobes.c:574:56: sparse: sparse: incorrect type in argument 4 (different base types) +@@ expected unsigned int [addressable] [usertype] opcode @@ got restricted __le32 [usertype] @@ + kernel/events/uprobes.c:574:56: sparse: expected unsigned int [addressable] [usertype] opcode + kernel/events/uprobes.c:574:56: sparse: got restricted __le32 [usertype] +>> kernel/events/uprobes.c:1483:32: sparse: sparse: incorrect type in initializer (different base types) +@@ expected unsigned int [usertype] insn @@ got restricted __le32 [usertype] @@ + kernel/events/uprobes.c:1483:32: sparse: expected unsigned int [usertype] insn + kernel/events/uprobes.c:1483:32: sparse: got restricted __le32 [usertype] + +use the __le32 to u32 for uprobe_opcode_t, to keep the same. + +Fixes: 60f07e22a73d ("arm64:uprobe fix the uprobe SWBP_INSN in big-endian") +Reported-by: kernel test robot +Signed-off-by: junhua huang +Link: https://lore.kernel.org/r/202212280954121197626@zte.com.cn +Signed-off-by: Will Deacon +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm64/include/asm/uprobes.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm64/include/asm/uprobes.h ++++ b/arch/arm64/include/asm/uprobes.h +@@ -14,7 +14,7 @@ + #define UPROBE_SWBP_INSN_SIZE AARCH64_INSN_SIZE + #define UPROBE_XOL_SLOT_BYTES AARCH64_INSN_SIZE + +-typedef u32 uprobe_opcode_t; ++typedef __le32 uprobe_opcode_t; + + struct arch_uprobe_task { + }; diff --git a/queue-5.4/series b/queue-5.4/series index 13f45baf809..3f618dbd7a6 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -421,3 +421,4 @@ nilfs2-fix-kernel-bug-due-to-missing-clearing-of-buffer-delay-flag.patch alsa-hda-realtek-add-subwoofer-quirk-for-acer-predator-g9-593.patch hv_netvsc-fix-vf-namespace-also-in-synthetic-nic-netdev_register-event.patch selinux-improve-error-checking-in-sel_write_load.patch +arm64-uprobes-change-the-uprobe_opcode_t-typedef-to-fix-the-sparse-warning.patch -- 2.47.2