Re: [PATCH] sparse: use static inline for __chk_{user,io}_ptr()
From: kernel test robot
Date: Mon Jun 29 2020 - 15:10:01 EST
Hi Luc,
I love your patch! Perhaps something to improve:
[auto build test WARNING on next-20200626]
[cannot apply to linux/master linus/master v5.8-rc2 v5.8-rc1 v5.7 v5.8-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Luc-Van-Oostenryck/sparse-use-static-inline-for-__chk_-user-io-_ptr/20200628-152401
base: 36e3135df4d426612fc77db26a312c2531108603
config: i386-randconfig-s001-20200629 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-3-gfa153962-dirty
# save the attached .config to linux build tree
make W=1 C= 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:337:9: sparse: sparse: cast removes address space '__user' of expression
>> arch/x86/kernel/signal.c:337: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:337:9: sparse: expected void const volatile [noderef] __user *ptr
arch/x86/kernel/signal.c:337:9: sparse: got unsigned long long [usertype] *
arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:397: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:397:9: sparse: expected void const volatile [noderef] __user *ptr
arch/x86/kernel/signal.c:397:9: sparse: got unsigned long long [usertype] *
arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
vim +337 arch/x86/kernel/signal.c
75779f05264b99 arch/x86/kernel/signal.c Hiroshi Shimamoto 2009-02-27 302
7e907f48980d66 arch/x86/kernel/signal_32.c Ingo Molnar 2008-03-06 303 static int
235b80226b986d arch/x86/kernel/signal.c Al Viro 2012-11-09 304 __setup_frame(int sig, struct ksignal *ksig, sigset_t *set,
7e907f48980d66 arch/x86/kernel/signal_32.c Ingo Molnar 2008-03-06 305 struct pt_regs *regs)
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 306 {
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 307 struct sigframe __user *frame;
7e907f48980d66 arch/x86/kernel/signal_32.c Ingo Molnar 2008-03-06 308 void __user *restorer;
b00d8f8f0b2b39 arch/x86/kernel/signal.c Al Viro 2020-02-15 309 void __user *fp = NULL;
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 310
b00d8f8f0b2b39 arch/x86/kernel/signal.c Al Viro 2020-02-15 311 frame = get_sigframe(&ksig->ka, regs, sizeof(*frame), &fp);
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 312
5c1f178094631e arch/x86/kernel/signal.c Al Viro 2020-02-15 313 if (!user_access_begin(frame, sizeof(*frame)))
3d0aedd9538e6b arch/x86/kernel/signal_32.c Hiroshi Shimamoto 2008-09-12 314 return -EFAULT;
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 315
5c1f178094631e arch/x86/kernel/signal.c Al Viro 2020-02-15 316 unsafe_put_user(sig, &frame->sig, Efault);
b00d8f8f0b2b39 arch/x86/kernel/signal.c Al Viro 2020-02-15 317 unsafe_put_sigcontext(&frame->sc, fp, regs, set, Efault);
5c1f178094631e arch/x86/kernel/signal.c Al Viro 2020-02-15 318 unsafe_put_user(set->sig[1], &frame->extramask[0], Efault);
1a3e4ca41c5a38 arch/x86/kernel/signal_32.c Roland McGrath 2008-04-09 319 if (current->mm->context.vdso)
6f121e548f8367 arch/x86/kernel/signal.c Andy Lutomirski 2014-05-05 320 restorer = current->mm->context.vdso +
0a6d1fa0d2b48f arch/x86/kernel/signal.c Andy Lutomirski 2015-10-05 321 vdso_image_32.sym___kernel_sigreturn;
9fbbd4dd17d071 arch/i386/kernel/signal.c Andi Kleen 2007-02-13 322 else
ade1af77129dea arch/x86/kernel/signal_32.c Jan Engelhardt 2008-01-30 323 restorer = &frame->retcode;
235b80226b986d arch/x86/kernel/signal.c Al Viro 2012-11-09 324 if (ksig->ka.sa.sa_flags & SA_RESTORER)
235b80226b986d arch/x86/kernel/signal.c Al Viro 2012-11-09 325 restorer = ksig->ka.sa.sa_restorer;
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 326
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 327 /* Set up to return from userspace. */
5c1f178094631e arch/x86/kernel/signal.c Al Viro 2020-02-15 328 unsafe_put_user(restorer, &frame->pretcode, Efault);
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 329
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 330 /*
7e907f48980d66 arch/x86/kernel/signal_32.c Ingo Molnar 2008-03-06 331 * This is popl %eax ; movl $__NR_sigreturn, %eax ; int $0x80
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 332 *
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 333 * WE DO NOT USE IT ANY MORE! It's only left here for historical
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 334 * reasons and because gdb uses it as a signature to notice
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 335 * signal handler stack frames.
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 336 */
5c1f178094631e arch/x86/kernel/signal.c Al Viro 2020-02-15 @337 unsafe_put_user(*((u64 *)&retcode), (u64 *)frame->retcode, Efault);
5c1f178094631e arch/x86/kernel/signal.c Al Viro 2020-02-15 338 user_access_end();
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 339
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 340 /* Set up registers for signal handler */
65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin 2008-01-30 341 regs->sp = (unsigned long)frame;
235b80226b986d arch/x86/kernel/signal.c Al Viro 2012-11-09 342 regs->ip = (unsigned long)ksig->ka.sa.sa_handler;
65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin 2008-01-30 343 regs->ax = (unsigned long)sig;
92bc2056855b32 arch/x86/kernel/signal_32.c Harvey Harrison 2008-02-08 344 regs->dx = 0;
92bc2056855b32 arch/x86/kernel/signal_32.c Harvey Harrison 2008-02-08 345 regs->cx = 0;
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 346
65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin 2008-01-30 347 regs->ds = __USER_DS;
65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin 2008-01-30 348 regs->es = __USER_DS;
65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin 2008-01-30 349 regs->ss = __USER_DS;
65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin 2008-01-30 350 regs->cs = __USER_CS;
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 351
283828f3c19ceb arch/i386/kernel/signal.c David Howells 2006-01-18 352 return 0;
b00d8f8f0b2b39 arch/x86/kernel/signal.c Al Viro 2020-02-15 353
b00d8f8f0b2b39 arch/x86/kernel/signal.c Al Viro 2020-02-15 354 Efault:
b00d8f8f0b2b39 arch/x86/kernel/signal.c Al Viro 2020-02-15 355 user_access_end();
b00d8f8f0b2b39 arch/x86/kernel/signal.c Al Viro 2020-02-15 356 return -EFAULT;
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 357 }
^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 358
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip