Re: [PATCH -mm 1/1] signal: simplify set_user_sigmask/restore_user_sigmask

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

 



Hi Oleg,

I love your patch! Perhaps something to improve:

[auto build test WARNING on mmotm/master]

url:    https://github.com/0day-ci/linux/commits/Oleg-Nesterov/signal-simplify-set_user_sigmask-restore_user_sigmask/20190606-062512
base:   git://git.cmpxchg.org/linux-mmotm.git master
config: sparc64-allyesconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=sparc64 

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

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   In file included from include/linux/poll.h:12:0,
                    from include/linux/ring_buffer.h:7,
                    from include/linux/trace_events.h:6,
                    from include/trace/syscall.h:7,
                    from include/linux/syscalls.h:86,
                    from kernel/signal.c:30:
   kernel/signal.c: In function 'set_user_sigmask':
   include/linux/uaccess.h:113:7: warning: 'kmask' may be used uninitialized in this function [-Wmaybe-uninitialized]
      res = raw_copy_from_user(to, from, n);
      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/signal.c:2960:12: note: 'kmask' was declared here
     sigset_t *kmask;
               ^~~~~
   kernel/signal.c: In function 'set_compat_user_sigmask':
>> kernel/signal.c:2986:6: warning: 'kmask' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (get_compat_sigset(kmask, umask))
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/kmask +2986 kernel/signal.c

  2975	
  2976	#ifdef CONFIG_COMPAT
  2977	int set_compat_user_sigmask(const compat_sigset_t __user *umask,
  2978				    size_t sigsetsize)
  2979	{
  2980		sigset_t *kmask;
  2981	
  2982		if (!umask)
  2983			return 0;
  2984		if (sigsetsize != sizeof(compat_sigset_t))
  2985			return -EINVAL;
> 2986		if (get_compat_sigset(kmask, umask))
  2987			return -EFAULT;
  2988	
  2989		set_restore_sigmask();
  2990		current->saved_sigmask = current->blocked;
  2991		set_current_blocked(kmask);
  2992	
  2993		return 0;
  2994	}
  2995	#endif
  2996	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

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