Hi Stanislaw,

[auto build test WARNING on net-next/master]
[also build test WARNING on v4.10-rc6]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:    
https://github.com/0day-ci/linux/commits/Stanislaw-Gruszka/ethtool-do-not-vzalloc-0-on-registers-dump/20170202-194352
config: i386-randconfig-x001-201705 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

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/uaccess.h:5:0,
                    from include/net/checksum.h:25,
                    from include/linux/skbuff.h:31,
                    from include/linux/if_ether.h:23,
                    from include/uapi/linux/ethtool.h:18,
                    from include/linux/ethtool.h:17,
                    from net/core/ethtool.c:18:
   net/core/ethtool.c: In function 'dev_ethtool':
>> arch/x86/include/asm/uaccess.h:722:5: warning: 'regbuf' may be used 
>> uninitialized in this function [-Wmaybe-uninitialized]
      n = _copy_to_user(to, from, n);
      ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/core/ethtool.c:1395:8: note: 'regbuf' was declared here
     void *regbuf;
           ^~~~~~

vim +/regbuf +722 arch/x86/include/asm/uaccess.h

0d025d27 Josh Poimboeuf  2016-08-30  706                __bad_copy_user();
3df7b41a Jan Beulich     2013-10-21  707  
3df7b41a Jan Beulich     2013-10-21  708        return n;
3df7b41a Jan Beulich     2013-10-21  709  }
3df7b41a Jan Beulich     2013-10-21  710  
e6971009 Kees Cook       2016-09-06  711  static __always_inline unsigned long 
__must_check
7a3d9b0f Jan Beulich     2013-10-21  712  copy_to_user(void __user *to, const 
void *from, unsigned long n)
7a3d9b0f Jan Beulich     2013-10-21  713  {
7a3d9b0f Jan Beulich     2013-10-21  714        int sz = 
__compiletime_object_size(from);
7a3d9b0f Jan Beulich     2013-10-21  715  
1771c6e1 Andrey Ryabinin 2016-05-20  716        kasan_check_read(from, n);
1771c6e1 Andrey Ryabinin 2016-05-20  717  
7a3d9b0f Jan Beulich     2013-10-21  718        might_fault();
7a3d9b0f Jan Beulich     2013-10-21  719  
5b710f34 Kees Cook       2016-06-23  720        if (likely(sz < 0 || sz >= n)) {
5b710f34 Kees Cook       2016-06-23  721                check_object_size(from, 
n, true);
7a3d9b0f Jan Beulich     2013-10-21 @722                n = _copy_to_user(to, 
from, n);
0d025d27 Josh Poimboeuf  2016-08-30  723        } else if 
(!__builtin_constant_p(n))
0d025d27 Josh Poimboeuf  2016-08-30  724                copy_user_overflow(sz, 
n);
7a3d9b0f Jan Beulich     2013-10-21  725        else
0d025d27 Josh Poimboeuf  2016-08-30  726                __bad_copy_user();
7a3d9b0f Jan Beulich     2013-10-21  727  
7a3d9b0f Jan Beulich     2013-10-21  728        return n;
7a3d9b0f Jan Beulich     2013-10-21  729  }
7a3d9b0f Jan Beulich     2013-10-21  730  

:::::: The code at line 722 was first introduced by commit
:::::: 7a3d9b0f3abbea957b829cdfff8169872c575642 x86: Unify copy_to_user() and 
add size checking to it

:::::: TO: Jan Beulich <[email protected]>
:::::: CC: Ingo Molnar <[email protected]>

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

Attachment: .config.gz
Description: application/gzip

Reply via email to