[vfs:untested.uaccess 18/22] arch/x86/kernel/signal.c:309:51: error: macro "unsafe_put_user" requires 3 arguments, but only 2 given

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git untested.uaccess
head:   094cadd628e4f679e8d2a5edbf9564ac1ec5bb03
commit: c6bab75849c01b2ea5ce1ac94a1c26db84efce6c [18/22] x86: __setup_frame(): consolidate uaccess areas
config: i386-alldefconfig (attached as .config)
compiler: gcc-7 (Debian 7.5.0-4) 7.5.0
reproduce:
        git checkout c6bab75849c01b2ea5ce1ac94a1c26db84efce6c
        # save the attached .config to linux build tree
        make ARCH=i386 

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

All errors (new ones prefixed by >>):

   arch/x86/kernel/signal.c: In function '__setup_frame':
>> arch/x86/kernel/signal.c:309:51: error: macro "unsafe_put_user" requires 3 arguments, but only 2 given
     unsafe_put_user(set->sig[1], &frame->extramask[0]), Efault)
                                                      ^
>> arch/x86/kernel/signal.c:309:2: error: 'unsafe_put_user' undeclared (first use in this function)
     unsafe_put_user(set->sig[1], &frame->extramask[0]), Efault)
     ^~~~~~~~~~~~~~~
   arch/x86/kernel/signal.c:309:2: note: each undeclared identifier is reported only once for each function it appears in
>> arch/x86/kernel/signal.c:309:54: error: 'Efault' undeclared (first use in this function)
     unsafe_put_user(set->sig[1], &frame->extramask[0]), Efault)
                                                         ^~~~~~
   arch/x86/kernel/signal.c:309:52: warning: left-hand operand of comma expression has no effect [-Wunused-value]
     unsafe_put_user(set->sig[1], &frame->extramask[0]), Efault)
                                                       ^
>> arch/x86/kernel/signal.c:309:60: error: expected ';' before ')' token
     unsafe_put_user(set->sig[1], &frame->extramask[0]), Efault)
                                                               ^
>> arch/x86/kernel/signal.c:309:60: error: expected statement before ')' token
   arch/x86/kernel/signal.c:298:6: warning: unused variable 'err' [-Wunused-variable]
     int err = 0;
         ^~~
   arch/x86/kernel/signal.c: In function 'x32_setup_rt_frame':
   arch/x86/kernel/signal.c:580:1: warning: label 'Efault' defined but not used [-Wunused-label]
    Efault:
    ^~~~~~

vim +/unsafe_put_user +309 arch/x86/kernel/signal.c

   291	
   292	static int
   293	__setup_frame(int sig, struct ksignal *ksig, sigset_t *set,
   294		      struct pt_regs *regs)
   295	{
   296		struct sigframe __user *frame;
   297		void __user *restorer;
   298		int err = 0;
   299		void __user *fpstate = NULL;
   300	
   301		frame = get_sigframe(&ksig->ka, regs, sizeof(*frame), &fpstate);
   302	
   303		if (!user_access_begin(frame, sizeof(*frame)))
   304			return -EFAULT;
   305	
   306		unsafe_put_user(sig, &frame->sig, Efault);
   307		if (setup_sigcontext(&frame->sc, fpstate, regs, set->sig[0]))
   308			goto Efault;
 > 309		unsafe_put_user(set->sig[1], &frame->extramask[0]), Efault)
   310		if (current->mm->context.vdso)
   311			restorer = current->mm->context.vdso +
   312				vdso_image_32.sym___kernel_sigreturn;
   313		else
   314			restorer = &frame->retcode;
   315		if (ksig->ka.sa.sa_flags & SA_RESTORER)
   316			restorer = ksig->ka.sa.sa_restorer;
   317	
   318		/* Set up to return from userspace.  */
   319		unsafe_put_user(restorer, &frame->pretcode, Efault);
   320	
   321		/*
   322		 * This is popl %eax ; movl $__NR_sigreturn, %eax ; int $0x80
   323		 *
   324		 * WE DO NOT USE IT ANY MORE! It's only left here for historical
   325		 * reasons and because gdb uses it as a signature to notice
   326		 * signal handler stack frames.
   327		 */
   328		unsafe_put_user(*((u64 *)&retcode), (u64 *)frame->retcode, Efault);
   329		user_access_end();
   330	
   331		/* Set up registers for signal handler */
   332		regs->sp = (unsigned long)frame;
   333		regs->ip = (unsigned long)ksig->ka.sa.sa_handler;
   334		regs->ax = (unsigned long)sig;
   335		regs->dx = 0;
   336		regs->cx = 0;
   337	
   338		regs->ds = __USER_DS;
   339		regs->es = __USER_DS;
   340		regs->ss = __USER_DS;
   341		regs->cs = __USER_CS;
   342	
   343		return 0;
   344	
   345	Efault:
   346		user_access_end();
   347		return -EFAULT;
   348	}
   349	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux