Commit fab9fbbd authored by junhua huang's avatar junhua huang Committed by Ze Zuo
Browse files

arm64/uprobes: change the uprobe_opcode_t typedef to fix the sparse warning

stable inclusion
from stable-v4.19.323
commit 974955b61fe226c0d837106738fc0fb5910d67a8
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB4P9Q
CVE: CVE-2024-50194

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=974955b61fe226c0d837106738fc0fb5910d67a8



--------------------------------

commit ef08c0fa 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: 60f07e22 ("arm64:uprobe fix the uprobe SWBP_INSN in big-endian")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarjunhua huang <huang.junhua@zte.com.cn>
Link: https://lore.kernel.org/r/202212280954121197626@zte.com.cn


Signed-off-by: default avatarWill Deacon <will@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarZe Zuo <zuoze1@huawei.com>
parent d6e79058
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,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 {
};