arch/x86/kernel/signal.c:936:9: sparse: sparse: incorrect type in argument 1 (different address spaces)

From: kernel test robot
Date: Wed Nov 17 2021 - 14:31:21 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ee1703cda8dc777e937dec172da55beaf1a74919
commit: 3aac3ebea08f2d342364f827c8979ab0e1dd591e x86/signal: Implement sigaltstack size validation
date: 3 weeks ago
config: i386-randconfig-s001-20211109 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3aac3ebea08f2d342364f827c8979ab0e1dd591e
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 3aac3ebea08f2d342364f827c8979ab0e1dd591e
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)
arch/x86/kernel/signal.c:358:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:358:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long long [usertype] * @@
arch/x86/kernel/signal.c:358:9: sparse: expected void const volatile [noderef] __user *ptr
arch/x86/kernel/signal.c:358:9: sparse: got unsigned long long [usertype] *
arch/x86/kernel/signal.c:358:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:358:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:358:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:358:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:358:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:358:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:358:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:358:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:358:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:418:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:418:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long long [usertype] * @@
arch/x86/kernel/signal.c:418:9: sparse: expected void const volatile [noderef] __user *ptr
arch/x86/kernel/signal.c:418:9: sparse: got unsigned long long [usertype] *
arch/x86/kernel/signal.c:418:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:418:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:418:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:418:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:418:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:418:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:418:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:418:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:418:9: sparse: sparse: cast removes address space '__user' of expression
>> arch/x86/kernel/signal.c:936:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct lockdep_map const *lock @@ got struct lockdep_map [noderef] __rcu * @@
arch/x86/kernel/signal.c:936:9: sparse: expected struct lockdep_map const *lock
arch/x86/kernel/signal.c:936:9: sparse: got struct lockdep_map [noderef] __rcu *

vim +936 arch/x86/kernel/signal.c

924
925 /*
926 * MINSIGSTKSZ is 2048 and can't be changed despite the fact that AVX512
927 * exceeds that size already. As such programs might never use the
928 * sigaltstack they just continued to work. While always checking against
929 * the real size would be correct, this might be considered a regression.
930 *
931 * Therefore avoid the sanity check, unless enforced by kernel config or
932 * command line option.
933 */
934 bool sigaltstack_size_valid(size_t ss_size)
935 {
> 936 lockdep_assert_held(&current->sighand->siglock);
937
938 if (strict_sigaltstack_size)
939 return ss_size > get_sigframe_size();
940
941 return true;
942 }
943 #endif /* CONFIG_DYNAMIC_SIGFRAME */
944

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip