From: kernel test robot <lkp@intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [peterz-queue:perf/core 29/41] arch/x86/kernel/uprobes.c:834:16: error: incompatible pointer types passing 'unsigned long *' to parameter of type 'u64 *' (aka 'unsigned long long *')
Date: Wed, 20 Aug 2025 19:31:00 +0200 [thread overview]
Message-ID: <202508201942.kN5khpRq-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git perf/core
head: 44711c518722e9e0594d07e7f7af72ec9d48c1dd
commit: 89f3fe617685431a4d82091c95ab14dd0d3b8dd6 [29/41] uprobes/x86: Fix shadow stack
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250820/202508201942.kN5khpRq-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250820/202508201942.kN5khpRq-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508201942.kN5khpRq-lkp@intel.com/
All errors (new ones prefixed by >>):
>> arch/x86/kernel/uprobes.c:834:16: error: incompatible pointer types passing 'unsigned long *' to parameter of type 'u64 *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
834 | if (shstk_pop(&sret) == 0 && sret != args.retaddr)
| ^~~~~
arch/x86/include/asm/shstk.h:40:34: note: passing argument to parameter 'val' here
40 | static inline int shstk_pop(u64 *val) { return -ENOTSUPP; }
| ^
1 error generated.
vim +834 arch/x86/kernel/uprobes.c
802
803 SYSCALL_DEFINE0(uprobe)
804 {
805 struct pt_regs *regs = task_pt_regs(current);
806 struct uprobe_syscall_args args;
807 unsigned long ip, sp, sret;
808 int err;
809
810 /* Allow execution only from uprobe trampolines. */
811 if (!in_uprobe_trampoline(regs->ip))
812 goto sigill;
813
814 err = copy_from_user(&args, (void __user *)regs->sp, sizeof(args));
815 if (err)
816 goto sigill;
817
818 ip = regs->ip;
819
820 /*
821 * expose the "right" values of ax/r11/cx/ip/sp to uprobe_consumer/s, plus:
822 * - adjust ip to the probe address, call saved next instruction address
823 * - adjust sp to the probe's stack frame (check trampoline code)
824 */
825 regs->ax = args.ax;
826 regs->r11 = args.r11;
827 regs->cx = args.cx;
828 regs->ip = args.retaddr - 5;
829 regs->sp += sizeof(args);
830 regs->orig_ax = -1;
831
832 sp = regs->sp;
833
> 834 if (shstk_pop(&sret) == 0 && sret != args.retaddr)
835 goto sigill;
836
837 handle_syscall_uprobe(regs, regs->ip);
838
839 /*
840 * Some of the uprobe consumers has changed sp, we can do nothing,
841 * just return via iret.
842 */
843 if (regs->sp != sp) {
844 /* skip the trampoline call */
845 if (args.retaddr - 5 == regs->ip)
846 regs->ip += 5;
847 return regs->ax;
848 }
849
850 regs->sp -= sizeof(args);
851
852 /* for the case uprobe_consumer has changed ax/r11/cx */
853 args.ax = regs->ax;
854 args.r11 = regs->r11;
855 args.cx = regs->cx;
856
857 /* keep return address unless we are instructed otherwise */
858 if (args.retaddr - 5 != regs->ip)
859 args.retaddr = regs->ip;
860
861 if (shstk_push(args.retaddr) == -EFAULT)
862 goto sigill;
863
864 regs->ip = ip;
865
866 err = copy_to_user((void __user *)regs->sp, &args, sizeof(args));
867 if (err)
868 goto sigill;
869
870 /* ensure sysret, see do_syscall_64() */
871 regs->r11 = regs->flags;
872 regs->cx = regs->ip;
873 return 0;
874
875 sigill:
876 force_sig(SIGILL);
877 return -1;
878 }
879
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2025-08-20 17:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-20 17:31 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-08-20 21:39 [peterz-queue:perf/core 29/41] arch/x86/kernel/uprobes.c:834:16: error: incompatible pointer types passing 'unsigned long *' to parameter of type 'u64 *' (aka 'unsigned long long *') kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202508201942.kN5khpRq-lkp@intel.com \
--to=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.