lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202203292149.t3xqiQ2d-lkp@intel.com>
Date:   Tue, 29 Mar 2022 21:41:43 +0800
From:   kernel test robot <lkp@...el.com>
To:     Kees Cook <keescook@...omium.org>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: lib/stackinit_kunit.c:334:1: sparse: sparse: Using plain integer as
 NULL pointer

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   1930a6e739c4b4a654a69164dbe39e554d228915
commit: 02788ebcf521fe78c24eb221fd1ed7f86792c330 lib: stackinit: Convert to KUnit
date:   8 days ago
config: powerpc-randconfig-s032-20220327 (https://download.01.org/0day-ci/archive/20220329/202203292149.t3xqiQ2d-lkp@intel.com/config)
compiler: powerpc-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=02788ebcf521fe78c24eb221fd1ed7f86792c330
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 02788ebcf521fe78c24eb221fd1ed7f86792c330
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=powerpc SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>


sparse warnings: (new ones prefixed by >>)
>> lib/stackinit_kunit.c:334:1: sparse: sparse: Using plain integer as NULL pointer
>> lib/stackinit_kunit.c:334:1: sparse: sparse: Using plain integer as NULL pointer
>> lib/stackinit_kunit.c:334:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:336:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:336:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:336:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:336:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:336:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:336:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:336:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:336:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:336:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:336:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:337:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:337:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:337:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:337:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:337:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:337:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:338:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:338:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:338:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:338:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:338:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:338:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:338:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:338:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:338:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:338:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:339:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:339:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:339:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:339:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:339:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:339:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:339:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:339:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:339:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:339:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:340:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:340:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:340:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:340:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:340:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:340:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:341:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:341:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:341:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:344:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:344:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:344:1: sparse: sparse: Using plain integer as NULL pointer
   lib/stackinit_kunit.c:346:1: sparse: sparse: Using plain integer as NULL pointer

vim +334 lib/stackinit_kunit.c

   303	
   304	#define DEFINE_SCALAR_TEST(name, init, xfail)			\
   305			DEFINE_TEST(name ## _ ## init, name, SCALAR,	\
   306				    init, xfail)
   307	
   308	#define DEFINE_SCALAR_TESTS(init, xfail)			\
   309			DEFINE_SCALAR_TEST(u8, init, xfail);		\
   310			DEFINE_SCALAR_TEST(u16, init, xfail);		\
   311			DEFINE_SCALAR_TEST(u32, init, xfail);		\
   312			DEFINE_SCALAR_TEST(u64, init, xfail);		\
   313			DEFINE_TEST(char_array_ ## init, unsigned char,	\
   314				    STRING, init, xfail)
   315	
   316	#define DEFINE_STRUCT_TEST(name, init, xfail)			\
   317			DEFINE_TEST(name ## _ ## init,			\
   318				    struct test_ ## name, STRUCT, init, \
   319				    xfail)
   320	
   321	#define DEFINE_STRUCT_TESTS(init, xfail)			\
   322			DEFINE_STRUCT_TEST(small_hole, init, xfail);	\
   323			DEFINE_STRUCT_TEST(big_hole, init, xfail);	\
   324			DEFINE_STRUCT_TEST(trailing_hole, init, xfail);	\
   325			DEFINE_STRUCT_TEST(packed, init, xfail)
   326	
   327	#define DEFINE_STRUCT_INITIALIZER_TESTS(base, xfail)		\
   328			DEFINE_STRUCT_TESTS(base ## _ ## partial,	\
   329					    xfail);			\
   330			DEFINE_STRUCT_TESTS(base ## _ ## all, xfail)
   331	
   332	/* These should be fully initialized all the time! */
   333	DEFINE_SCALAR_TESTS(zero, ALWAYS_PASS);
 > 334	DEFINE_STRUCT_TESTS(zero, ALWAYS_PASS);
   335	/* Struct initializers: padding may be left uninitialized. */
   336	DEFINE_STRUCT_INITIALIZER_TESTS(static, STRONG_PASS);
   337	DEFINE_STRUCT_INITIALIZER_TESTS(dynamic, STRONG_PASS);
   338	DEFINE_STRUCT_INITIALIZER_TESTS(runtime, STRONG_PASS);
   339	DEFINE_STRUCT_INITIALIZER_TESTS(assigned_static, STRONG_PASS);
   340	DEFINE_STRUCT_INITIALIZER_TESTS(assigned_dynamic, STRONG_PASS);
   341	DEFINE_STRUCT_TESTS(assigned_copy, ALWAYS_FAIL);
   342	/* No initialization without compiler instrumentation. */
   343	DEFINE_SCALAR_TESTS(none, STRONG_PASS);
   344	DEFINE_STRUCT_TESTS(none, BYREF_PASS);
   345	/* Initialization of members with __user attribute. */
   346	DEFINE_TEST(user, struct test_user, STRUCT, none, USER_PASS);
   347	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ