arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '<asn:1>' of expression
From: kbuild test robot
Date: Tue Jun 02 2020 - 04:23:46 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 3d77e6a8804abcc0504c904bd6e5cdf3a5cf8162
commit: 57d563c8292569f2849569853e846bf740df5032 x86: ia32_setup_rt_frame(): consolidate uaccess areas
date: 10 weeks ago
:::::: branch date: 9 hours ago
:::::: commit date: 10 weeks ago
config: x86_64-randconfig-s021-20200601 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-243-gc100a7ab-dirty
git checkout 57d563c8292569f2849569853e846bf740df5032
# save the attached .config to linux build tree
make W=1 C=1 ARCH=x86_64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@xxxxxxxxx>
sparse warnings: (new ones prefixed by >>)
>> arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '<asn:1>' of expression
arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:1> * @@ got unsigned long long [usertype] * @@
arch/x86/ia32/ia32_signal.c:350:9: sparse: expected void const volatile [noderef] <asn:1> *
arch/x86/ia32/ia32_signal.c:350:9: sparse: got unsigned long long [usertype] *
>> arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '<asn:1>' of expression
>> arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '<asn:1>' of expression
>> arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '<asn:1>' of expression
>> arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '<asn:1>' of expression
>> arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '<asn:1>' of expression
>> arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '<asn:1>' of expression
>> arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '<asn:1>' of expression
>> arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '<asn:1>' of expression
>> arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '<asn:1>' of expression
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=57d563c8292569f2849569853e846bf740df5032
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout 57d563c8292569f2849569853e846bf740df5032
vim +350 arch/x86/ia32/ia32_signal.c
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds 2005-04-16 299
235b80226b986d arch/x86/ia32/ia32_signal.c Al Viro 2012-11-09 300 int ia32_setup_rt_frame(int sig, struct ksignal *ksig,
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds 2005-04-16 301 compat_sigset_t *set, struct pt_regs *regs)
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds 2005-04-16 302 {
3b0d29ee1c73b6 arch/x86/ia32/ia32_signal.c Hiroshi Shimamoto 2008-12-17 303 struct rt_sigframe_ia32 __user *frame;
af65d64845a90c arch/x86/ia32/ia32_signal.c Roland McGrath 2008-01-30 304 void __user *restorer;
44a1d996325982 arch/x86/ia32/ia32_signal.c Al Viro 2020-02-15 305 void __user *fp = NULL;
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds 2005-04-16 306
57d563c8292569 arch/x86/ia32/ia32_signal.c Al Viro 2020-02-15 307 /* unsafe_put_user optimizes that into a single 8 byte store */
99b9cdf758af70 arch/x86/ia32/ia32_signal.c Thomas Gleixner 2008-01-30 308 static const struct {
99b9cdf758af70 arch/x86/ia32/ia32_signal.c Thomas Gleixner 2008-01-30 309 u8 movl;
99b9cdf758af70 arch/x86/ia32/ia32_signal.c Thomas Gleixner 2008-01-30 310 u32 val;
99b9cdf758af70 arch/x86/ia32/ia32_signal.c Thomas Gleixner 2008-01-30 311 u16 int80;
9cc3c49ed1b1db arch/x86/ia32/ia32_signal.c Hiroshi Shimamoto 2008-11-11 312 u8 pad;
99b9cdf758af70 arch/x86/ia32/ia32_signal.c Thomas Gleixner 2008-01-30 313 } __attribute__((packed)) code = {
99b9cdf758af70 arch/x86/ia32/ia32_signal.c Thomas Gleixner 2008-01-30 314 0xb8,
99b9cdf758af70 arch/x86/ia32/ia32_signal.c Thomas Gleixner 2008-01-30 315 __NR_ia32_rt_sigreturn,
99b9cdf758af70 arch/x86/ia32/ia32_signal.c Thomas Gleixner 2008-01-30 316 0x80cd,
99b9cdf758af70 arch/x86/ia32/ia32_signal.c Thomas Gleixner 2008-01-30 317 0,
99b9cdf758af70 arch/x86/ia32/ia32_signal.c Thomas Gleixner 2008-01-30 318 };
99b9cdf758af70 arch/x86/ia32/ia32_signal.c Thomas Gleixner 2008-01-30 319
44a1d996325982 arch/x86/ia32/ia32_signal.c Al Viro 2020-02-15 320 frame = get_sigframe(ksig, regs, sizeof(*frame), &fp);
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds 2005-04-16 321
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c Al Viro 2020-02-15 322 if (!user_access_begin(frame, sizeof(*frame)))
3d0aedd9538e6b arch/x86/ia32/ia32_signal.c Hiroshi Shimamoto 2008-09-12 323 return -EFAULT;
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds 2005-04-16 324
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c Al Viro 2020-02-15 325 unsafe_put_user(sig, &frame->sig, Efault);
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c Al Viro 2020-02-15 326 unsafe_put_user(ptr_to_compat(&frame->info), &frame->pinfo, Efault);
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c Al Viro 2020-02-15 327 unsafe_put_user(ptr_to_compat(&frame->uc), &frame->puc, Efault);
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds 2005-04-16 328
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds 2005-04-16 329 /* Create the ucontext. */
ff661350157266 arch/x86/ia32/ia32_signal.c Marco Elver 2019-07-11 330 if (static_cpu_has(X86_FEATURE_XSAVE))
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c Al Viro 2020-02-15 331 unsafe_put_user(UC_FP_XSTATE, &frame->uc.uc_flags, Efault);
c37b5efea43f9e arch/x86/ia32/ia32_signal.c Suresh Siddha 2008-07-29 332 else
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c Al Viro 2020-02-15 333 unsafe_put_user(0, &frame->uc.uc_flags, Efault);
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c Al Viro 2020-02-15 334 unsafe_put_user(0, &frame->uc.uc_link, Efault);
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c Al Viro 2020-02-15 335 unsafe_compat_save_altstack(&frame->uc.uc_stack, regs->sp, Efault);
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds 2005-04-16 336
235b80226b986d arch/x86/ia32/ia32_signal.c Al Viro 2012-11-09 337 if (ksig->ka.sa.sa_flags & SA_RESTORER)
235b80226b986d arch/x86/ia32/ia32_signal.c Al Viro 2012-11-09 338 restorer = ksig->ka.sa.sa_restorer;
af65d64845a90c arch/x86/ia32/ia32_signal.c Roland McGrath 2008-01-30 339 else
6f121e548f8367 arch/x86/ia32/ia32_signal.c Andy Lutomirski 2014-05-05 340 restorer = current->mm->context.vdso +
0a6d1fa0d2b48f arch/x86/ia32/ia32_signal.c Andy Lutomirski 2015-10-05 341 vdso_image_32.sym___kernel_rt_sigreturn;
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c Al Viro 2020-02-15 342 unsafe_put_user(ptr_to_compat(restorer), &frame->pretcode, Efault);
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds 2005-04-16 343
99b9cdf758af70 arch/x86/ia32/ia32_signal.c Thomas Gleixner 2008-01-30 344 /*
99b9cdf758af70 arch/x86/ia32/ia32_signal.c Thomas Gleixner 2008-01-30 345 * Not actually used anymore, but left because some gdb
99b9cdf758af70 arch/x86/ia32/ia32_signal.c Thomas Gleixner 2008-01-30 346 * versions need it.
99b9cdf758af70 arch/x86/ia32/ia32_signal.c Thomas Gleixner 2008-01-30 347 */
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c Al Viro 2020-02-15 348 unsafe_put_user(*((u64 *)&code), (u64 __user *)frame->retcode, Efault);
44a1d996325982 arch/x86/ia32/ia32_signal.c Al Viro 2020-02-15 349 unsafe_put_sigcontext32(&frame->uc.uc_mcontext, fp, regs, set, Efault);
57d563c8292569 arch/x86/ia32/ia32_signal.c Al Viro 2020-02-15 @350 unsafe_put_user(*(__u64 *)set, (__u64 *)&frame->uc.uc_sigmask, Efault);
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip