tree: https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git for-next head: 976a5f29dd6b139ea0de82e5d41d604ff5c11afe commit: 9b24ec57688addbf30fb80083a3d380eb02dda8d [328/342] get_compat_sigset() config: x86_64-randconfig-b0-09071442 (attached as .config) compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7 reproduce: git checkout 9b24ec57688addbf30fb80083a3d380eb02dda8d # save the attached .config to linux build tree make ARCH=x86_64 All warnings (new ones prefixed by >>): kernel/signal.c: In function 'C_SYSC_rt_sigaction': >> kernel/signal.c:3405: warning: unused variable 'mask' vim +/mask +3405 kernel/signal.c ^1da177e4 Linus Torvalds 2005-04-16 3352 eaca6eae3 Al Viro 2012-11-25 3353 #ifndef CONFIG_ODD_RT_SIGACTION 41c57892a Randy Dunlap 2011-04-04 3354 /** 41c57892a Randy Dunlap 2011-04-04 3355 * sys_rt_sigaction - alter an action taken by a process 41c57892a Randy Dunlap 2011-04-04 3356 * @sig: signal to be sent f9fa0bc1f Randy Dunlap 2011-04-08 3357 * @act: new sigaction f9fa0bc1f Randy Dunlap 2011-04-08 3358 * @oact: used to save the previous sigaction 41c57892a Randy Dunlap 2011-04-04 3359 * @sigsetsize: size of sigset_t type 41c57892a Randy Dunlap 2011-04-04 3360 */ d4e82042c Heiko Carstens 2009-01-14 3361 SYSCALL_DEFINE4(rt_sigaction, int, sig, d4e82042c Heiko Carstens 2009-01-14 3362 const struct sigaction __user *, act, d4e82042c Heiko Carstens 2009-01-14 3363 struct sigaction __user *, oact, d4e82042c Heiko Carstens 2009-01-14 3364 size_t, sigsetsize) ^1da177e4 Linus Torvalds 2005-04-16 3365 { ^1da177e4 Linus Torvalds 2005-04-16 3366 struct k_sigaction new_sa, old_sa; ^1da177e4 Linus Torvalds 2005-04-16 3367 int ret = -EINVAL; ^1da177e4 Linus Torvalds 2005-04-16 3368 ^1da177e4 Linus Torvalds 2005-04-16 3369 /* XXX: Don't preclude handling different sized sigset_t's. */ ^1da177e4 Linus Torvalds 2005-04-16 3370 if (sigsetsize != sizeof(sigset_t)) ^1da177e4 Linus Torvalds 2005-04-16 3371 goto out; ^1da177e4 Linus Torvalds 2005-04-16 3372 ^1da177e4 Linus Torvalds 2005-04-16 3373 if (act) { ^1da177e4 Linus Torvalds 2005-04-16 3374 if (copy_from_user(&new_sa.sa, act, sizeof(new_sa.sa))) ^1da177e4 Linus Torvalds 2005-04-16 3375 return -EFAULT; ^1da177e4 Linus Torvalds 2005-04-16 3376 } ^1da177e4 Linus Torvalds 2005-04-16 3377 ^1da177e4 Linus Torvalds 2005-04-16 3378 ret = do_sigaction(sig, act ? &new_sa : NULL, oact ? &old_sa : NULL); ^1da177e4 Linus Torvalds 2005-04-16 3379 ^1da177e4 Linus Torvalds 2005-04-16 3380 if (!ret && oact) { ^1da177e4 Linus Torvalds 2005-04-16 3381 if (copy_to_user(oact, &old_sa.sa, sizeof(old_sa.sa))) ^1da177e4 Linus Torvalds 2005-04-16 3382 return -EFAULT; ^1da177e4 Linus Torvalds 2005-04-16 3383 } ^1da177e4 Linus Torvalds 2005-04-16 3384 out: ^1da177e4 Linus Torvalds 2005-04-16 3385 return ret; ^1da177e4 Linus Torvalds 2005-04-16 3386 } 08d32fe50 Al Viro 2012-12-25 3387 #ifdef CONFIG_COMPAT 08d32fe50 Al Viro 2012-12-25 3388 COMPAT_SYSCALL_DEFINE4(rt_sigaction, int, sig, 08d32fe50 Al Viro 2012-12-25 3389 const struct compat_sigaction __user *, act, 08d32fe50 Al Viro 2012-12-25 3390 struct compat_sigaction __user *, oact, 08d32fe50 Al Viro 2012-12-25 3391 compat_size_t, sigsetsize) 08d32fe50 Al Viro 2012-12-25 3392 { 08d32fe50 Al Viro 2012-12-25 3393 struct k_sigaction new_ka, old_ka; 08d32fe50 Al Viro 2012-12-25 3394 #ifdef __ARCH_HAS_SA_RESTORER 08d32fe50 Al Viro 2012-12-25 3395 compat_uptr_t restorer; 08d32fe50 Al Viro 2012-12-25 3396 #endif 08d32fe50 Al Viro 2012-12-25 3397 int ret; 08d32fe50 Al Viro 2012-12-25 3398 08d32fe50 Al Viro 2012-12-25 3399 /* XXX: Don't preclude handling different sized sigset_t's. */ 08d32fe50 Al Viro 2012-12-25 3400 if (sigsetsize != sizeof(compat_sigset_t)) 08d32fe50 Al Viro 2012-12-25 3401 return -EINVAL; 08d32fe50 Al Viro 2012-12-25 3402 08d32fe50 Al Viro 2012-12-25 3403 if (act) { 08d32fe50 Al Viro 2012-12-25 3404 compat_uptr_t handler; fc271087e Dmitry V. Levin 2017-08-22 @3405 compat_sigset_t mask; 08d32fe50 Al Viro 2012-12-25 3406 ret = get_user(handler, &act->sa_handler); 08d32fe50 Al Viro 2012-12-25 3407 new_ka.sa.sa_handler = compat_ptr(handler); 08d32fe50 Al Viro 2012-12-25 3408 #ifdef __ARCH_HAS_SA_RESTORER 08d32fe50 Al Viro 2012-12-25 3409 ret |= get_user(restorer, &act->sa_restorer); 08d32fe50 Al Viro 2012-12-25 3410 new_ka.sa.sa_restorer = compat_ptr(restorer); 08d32fe50 Al Viro 2012-12-25 3411 #endif 9b24ec576 Al Viro 2017-09-03 3412 ret |= get_compat_sigset(&new_ka.sa.sa_mask, &act->sa_mask); 3ddc5b46a Mathieu Desnoyers 2013-09-11 3413 ret |= get_user(new_ka.sa.sa_flags, &act->sa_flags); 08d32fe50 Al Viro 2012-12-25 3414 if (ret) 08d32fe50 Al Viro 2012-12-25 3415 return -EFAULT; 08d32fe50 Al Viro 2012-12-25 3416 } 08d32fe50 Al Viro 2012-12-25 3417 08d32fe50 Al Viro 2012-12-25 3418 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); 08d32fe50 Al Viro 2012-12-25 3419 if (!ret && oact) { 08d32fe50 Al Viro 2012-12-25 3420 ret = put_user(ptr_to_compat(old_ka.sa.sa_handler), 08d32fe50 Al Viro 2012-12-25 3421 &oact->sa_handler); fc271087e Dmitry V. Levin 2017-08-22 3422 ret |= put_compat_sigset(&oact->sa_mask, &old_ka.sa.sa_mask, fc271087e Dmitry V. Levin 2017-08-22 3423 sizeof(oact->sa_mask)); 3ddc5b46a Mathieu Desnoyers 2013-09-11 3424 ret |= put_user(old_ka.sa.sa_flags, &oact->sa_flags); 08d32fe50 Al Viro 2012-12-25 3425 #ifdef __ARCH_HAS_SA_RESTORER 08d32fe50 Al Viro 2012-12-25 3426 ret |= put_user(ptr_to_compat(old_ka.sa.sa_restorer), 08d32fe50 Al Viro 2012-12-25 3427 &oact->sa_restorer); 08d32fe50 Al Viro 2012-12-25 3428 #endif 08d32fe50 Al Viro 2012-12-25 3429 } 08d32fe50 Al Viro 2012-12-25 3430 return ret; 08d32fe50 Al Viro 2012-12-25 3431 } 08d32fe50 Al Viro 2012-12-25 3432 #endif eaca6eae3 Al Viro 2012-11-25 3433 #endif /* !CONFIG_ODD_RT_SIGACTION */ ^1da177e4 Linus Torvalds 2005-04-16 3434 :::::: The code at line 3405 was first introduced by commit :::::: fc271087ebcb68833acf3f67c004da584293ca04 signal: replace sigset_to_compat() with put_compat_sigset() :::::: TO: Dmitry V. Levin <ldv@xxxxxxxxxxxx> :::::: CC: Al Viro <viro@xxxxxxxxxxxxxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip