* [sashal-linux-stable:pending-5.13 38/39] arch/s390/kernel/signal.c:340:14: error: implicit declaration of function 'VDSO64_SYMBOL'
@ 2021-08-06 20:13 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-08-06 20:13 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 19555 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git pending-5.13
head: af94cbab01cc23139bdf25372f8e33895a5650e8
commit: b7ad0b2295c98d8ea603c7e916745bd55c645f2f [38/39] s390/signal: switch to using vdso for sigreturn and syscall restart
config: s390-randconfig-r006-20210806 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 42b9c2a17a0b63cccf3ac197a82f91b28e53e643)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/commit/?id=b7ad0b2295c98d8ea603c7e916745bd55c645f2f
git remote add sashal-linux-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable pending-5.13
git checkout b7ad0b2295c98d8ea603c7e916745bd55c645f2f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from arch/s390/kernel/signal.c:19:
In file included from include/linux/entry-common.h:6:
In file included from include/linux/tracehook.h:50:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:25:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:75:
include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:36:59: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
^
include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
#define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
^
In file included from arch/s390/kernel/signal.c:19:
In file included from include/linux/entry-common.h:6:
In file included from include/linux/tracehook.h:50:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:25:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:75:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
#define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
^
In file included from arch/s390/kernel/signal.c:19:
In file included from include/linux/entry-common.h:6:
In file included from include/linux/tracehook.h:50:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:25:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:75:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
>> arch/s390/kernel/signal.c:340:14: error: implicit declaration of function 'VDSO64_SYMBOL' [-Werror,-Wimplicit-function-declaration]
restorer = VDSO64_SYMBOL(current, sigreturn);
^
>> arch/s390/kernel/signal.c:340:37: error: use of undeclared identifier 'sigreturn'
restorer = VDSO64_SYMBOL(current, sigreturn);
^
arch/s390/kernel/signal.c:398:14: error: implicit declaration of function 'VDSO64_SYMBOL' [-Werror,-Wimplicit-function-declaration]
restorer = VDSO64_SYMBOL(current, rt_sigreturn);
^
>> arch/s390/kernel/signal.c:398:37: error: use of undeclared identifier 'rt_sigreturn'; did you mean 'sys_sigreturn'?
restorer = VDSO64_SYMBOL(current, rt_sigreturn);
^~~~~~~~~~~~
sys_sigreturn
arch/s390/kernel/entry.h:51:6: note: 'sys_sigreturn' declared here
long sys_sigreturn(void);
^
>> arch/s390/kernel/signal.c:514:22: error: implicit declaration of function 'VDSO32_SYMBOL' [-Werror,-Wimplicit-function-declaration]
regs->psw.addr = VDSO32_SYMBOL(current, restart_syscall);
^
arch/s390/kernel/signal.c:516:22: error: implicit declaration of function 'VDSO64_SYMBOL' [-Werror,-Wimplicit-function-declaration]
regs->psw.addr = VDSO64_SYMBOL(current, restart_syscall);
^
12 warnings and 6 errors generated.
--
>> arch/s390/kernel/compat_signal.c:307:14: error: implicit declaration of function 'VDSO32_SYMBOL' [-Werror,-Wimplicit-function-declaration]
restorer = VDSO32_SYMBOL(current, sigreturn);
^
>> arch/s390/kernel/compat_signal.c:307:37: error: use of undeclared identifier 'sigreturn'
restorer = VDSO32_SYMBOL(current, sigreturn);
^
arch/s390/kernel/compat_signal.c:370:14: error: implicit declaration of function 'VDSO32_SYMBOL' [-Werror,-Wimplicit-function-declaration]
restorer = VDSO32_SYMBOL(current, rt_sigreturn);
^
>> arch/s390/kernel/compat_signal.c:370:37: error: use of undeclared identifier 'rt_sigreturn'; did you mean 'sys_sigreturn'?
restorer = VDSO32_SYMBOL(current, rt_sigreturn);
^~~~~~~~~~~~
sys_sigreturn
arch/s390/kernel/entry.h:51:6: note: 'sys_sigreturn' declared here
long sys_sigreturn(void);
^
4 errors generated.
vim +/VDSO64_SYMBOL +340 arch/s390/kernel/signal.c
288
289 static int setup_frame(int sig, struct k_sigaction *ka,
290 sigset_t *set, struct pt_regs * regs)
291 {
292 struct sigframe __user *frame;
293 struct sigcontext sc;
294 unsigned long restorer;
295 size_t frame_size;
296
297 /*
298 * gprs_high are only present for a 31-bit task running on
299 * a 64-bit kernel (see compat_signal.c) but the space for
300 * gprs_high need to be allocated if vector registers are
301 * included in the signal frame on a 31-bit system.
302 */
303 frame_size = sizeof(*frame) - sizeof(frame->sregs_ext);
304 if (MACHINE_HAS_VX)
305 frame_size += sizeof(frame->sregs_ext);
306 frame = get_sigframe(ka, regs, frame_size);
307 if (frame == (void __user *) -1UL)
308 return -EFAULT;
309
310 /* Set up backchain. */
311 if (__put_user(regs->gprs[15], (addr_t __user *) frame))
312 return -EFAULT;
313
314 /* Create struct sigcontext on the signal stack */
315 memcpy(&sc.oldmask, &set->sig, _SIGMASK_COPY_SIZE);
316 sc.sregs = (_sigregs __user __force *) &frame->sregs;
317 if (__copy_to_user(&frame->sc, &sc, sizeof(frame->sc)))
318 return -EFAULT;
319
320 /* Store registers needed to create the signal frame */
321 store_sigregs();
322
323 /* Create _sigregs on the signal stack */
324 if (save_sigregs(regs, &frame->sregs))
325 return -EFAULT;
326
327 /* Place signal number on stack to allow backtrace from handler. */
328 if (__put_user(regs->gprs[2], (int __user *) &frame->signo))
329 return -EFAULT;
330
331 /* Create _sigregs_ext on the signal stack */
332 if (save_sigregs_ext(regs, &frame->sregs_ext))
333 return -EFAULT;
334
335 /* Set up to return from userspace. If provided, use a stub
336 already in userspace. */
337 if (ka->sa.sa_flags & SA_RESTORER)
338 restorer = (unsigned long) ka->sa.sa_restorer;
339 else
> 340 restorer = VDSO64_SYMBOL(current, sigreturn);
341
342 /* Set up registers for signal handler */
343 regs->gprs[14] = restorer;
344 regs->gprs[15] = (unsigned long) frame;
345 /* Force default amode and default user address space control. */
346 regs->psw.mask = PSW_MASK_EA | PSW_MASK_BA |
347 (PSW_USER_BITS & PSW_MASK_ASC) |
348 (regs->psw.mask & ~PSW_MASK_ASC);
349 regs->psw.addr = (unsigned long) ka->sa.sa_handler;
350
351 regs->gprs[2] = sig;
352 regs->gprs[3] = (unsigned long) &frame->sc;
353
354 /* We forgot to include these in the sigcontext.
355 To avoid breaking binary compatibility, they are passed as args. */
356 if (sig == SIGSEGV || sig == SIGBUS || sig == SIGILL ||
357 sig == SIGTRAP || sig == SIGFPE) {
358 /* set extra registers only for synchronous signals */
359 regs->gprs[4] = regs->int_code & 127;
360 regs->gprs[5] = regs->int_parm_long;
361 regs->gprs[6] = current->thread.last_break;
362 }
363 return 0;
364 }
365
366 static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
367 struct pt_regs *regs)
368 {
369 struct rt_sigframe __user *frame;
370 unsigned long uc_flags, restorer;
371 size_t frame_size;
372
373 frame_size = sizeof(struct rt_sigframe) - sizeof(_sigregs_ext);
374 /*
375 * gprs_high are only present for a 31-bit task running on
376 * a 64-bit kernel (see compat_signal.c) but the space for
377 * gprs_high need to be allocated if vector registers are
378 * included in the signal frame on a 31-bit system.
379 */
380 uc_flags = 0;
381 if (MACHINE_HAS_VX) {
382 frame_size += sizeof(_sigregs_ext);
383 uc_flags |= UC_VXRS;
384 }
385 frame = get_sigframe(&ksig->ka, regs, frame_size);
386 if (frame == (void __user *) -1UL)
387 return -EFAULT;
388
389 /* Set up backchain. */
390 if (__put_user(regs->gprs[15], (addr_t __user *) frame))
391 return -EFAULT;
392
393 /* Set up to return from userspace. If provided, use a stub
394 already in userspace. */
395 if (ksig->ka.sa.sa_flags & SA_RESTORER)
396 restorer = (unsigned long) ksig->ka.sa.sa_restorer;
397 else
> 398 restorer = VDSO64_SYMBOL(current, rt_sigreturn);
399
400 /* Create siginfo on the signal stack */
401 if (copy_siginfo_to_user(&frame->info, &ksig->info))
402 return -EFAULT;
403
404 /* Store registers needed to create the signal frame */
405 store_sigregs();
406
407 /* Create ucontext on the signal stack. */
408 if (__put_user(uc_flags, &frame->uc.uc_flags) ||
409 __put_user(NULL, &frame->uc.uc_link) ||
410 __save_altstack(&frame->uc.uc_stack, regs->gprs[15]) ||
411 save_sigregs(regs, &frame->uc.uc_mcontext) ||
412 __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)) ||
413 save_sigregs_ext(regs, &frame->uc.uc_mcontext_ext))
414 return -EFAULT;
415
416 /* Set up registers for signal handler */
417 regs->gprs[14] = restorer;
418 regs->gprs[15] = (unsigned long) frame;
419 /* Force default amode and default user address space control. */
420 regs->psw.mask = PSW_MASK_EA | PSW_MASK_BA |
421 (PSW_USER_BITS & PSW_MASK_ASC) |
422 (regs->psw.mask & ~PSW_MASK_ASC);
423 regs->psw.addr = (unsigned long) ksig->ka.sa.sa_handler;
424
425 regs->gprs[2] = ksig->sig;
426 regs->gprs[3] = (unsigned long) &frame->info;
427 regs->gprs[4] = (unsigned long) &frame->uc;
428 regs->gprs[5] = current->thread.last_break;
429 return 0;
430 }
431
432 static void handle_signal(struct ksignal *ksig, sigset_t *oldset,
433 struct pt_regs *regs)
434 {
435 int ret;
436
437 /* Set up the stack frame */
438 if (ksig->ka.sa.sa_flags & SA_SIGINFO)
439 ret = setup_rt_frame(ksig, oldset, regs);
440 else
441 ret = setup_frame(ksig->sig, &ksig->ka, oldset, regs);
442
443 signal_setup_done(ret, ksig, test_thread_flag(TIF_SINGLE_STEP));
444 }
445
446 /*
447 * Note that 'init' is a special process: it doesn't get signals it doesn't
448 * want to handle. Thus you cannot kill init even with a SIGKILL even by
449 * mistake.
450 *
451 * Note that we go through the signals twice: once to check the signals that
452 * the kernel can handle, and then we build all the user-level signal handling
453 * stack-frames in one go after that.
454 */
455
456 void arch_do_signal_or_restart(struct pt_regs *regs, bool has_signal)
457 {
458 struct ksignal ksig;
459 sigset_t *oldset = sigmask_to_save();
460
461 /*
462 * Get signal to deliver. When running under ptrace, at this point
463 * the debugger may change all our registers, including the system
464 * call information.
465 */
466 current->thread.system_call =
467 test_pt_regs_flag(regs, PIF_SYSCALL) ? regs->int_code : 0;
468
469 if (has_signal && get_signal(&ksig)) {
470 /* Whee! Actually deliver the signal. */
471 if (current->thread.system_call) {
472 regs->int_code = current->thread.system_call;
473 /* Check for system call restarting. */
474 switch (regs->gprs[2]) {
475 case -ERESTART_RESTARTBLOCK:
476 case -ERESTARTNOHAND:
477 regs->gprs[2] = -EINTR;
478 break;
479 case -ERESTARTSYS:
480 if (!(ksig.ka.sa.sa_flags & SA_RESTART)) {
481 regs->gprs[2] = -EINTR;
482 break;
483 }
484 fallthrough;
485 case -ERESTARTNOINTR:
486 regs->gprs[2] = regs->orig_gpr2;
487 regs->psw.addr =
488 __rewind_psw(regs->psw,
489 regs->int_code >> 16);
490 break;
491 }
492 }
493 /* No longer in a system call */
494 clear_pt_regs_flag(regs, PIF_SYSCALL);
495
496 rseq_signal_deliver(&ksig, regs);
497 if (is_compat_task())
498 handle_signal32(&ksig, oldset, regs);
499 else
500 handle_signal(&ksig, oldset, regs);
501 return;
502 }
503
504 /* No handlers present - check for system call restart */
505 clear_pt_regs_flag(regs, PIF_SYSCALL);
506 if (current->thread.system_call) {
507 regs->int_code = current->thread.system_call;
508 switch (regs->gprs[2]) {
509 case -ERESTART_RESTARTBLOCK:
510 /* Restart with sys_restart_syscall */
511 regs->gprs[2] = regs->orig_gpr2;
512 current->restart_block.arch_data = regs->psw.addr;
513 if (is_compat_task())
> 514 regs->psw.addr = VDSO32_SYMBOL(current, restart_syscall);
515 else
516 regs->psw.addr = VDSO64_SYMBOL(current, restart_syscall);
517 if (test_thread_flag(TIF_SINGLE_STEP))
518 clear_thread_flag(TIF_PER_TRAP);
519 break;
520 case -ERESTARTNOHAND:
521 case -ERESTARTSYS:
522 case -ERESTARTNOINTR:
523 regs->gprs[2] = regs->orig_gpr2;
524 regs->psw.addr = __rewind_psw(regs->psw, regs->int_code >> 16);
525 if (test_thread_flag(TIF_SINGLE_STEP))
526 clear_thread_flag(TIF_PER_TRAP);
527 break;
528 }
529 }
530
531 /*
532 * If there's no signal to deliver, we just put the saved sigmask back.
533 */
534 restore_saved_sigmask();
535 }
536
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 25582 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-08-06 20:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-06 20:13 [sashal-linux-stable:pending-5.13 38/39] arch/s390/kernel/signal.c:340:14: error: implicit declaration of function 'VDSO64_SYMBOL' kernel test robot
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.