CC: [email protected] CC: [email protected] BCC: [email protected] CC: Linux Memory Management List <[email protected]> TO: Kees Cook <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 71941773e143369a73c9c4a3b62fbb60736a1182 commit: 8d60400704e503ded9f0c2ea32c2303d22955888 [8478/11953] lib: stackinit: Convert to KUnit :::::: branch date: 5 days ago :::::: commit date: 2 weeks ago config: mips-randconfig-c004-20220302 (https://download.01.org/0day-ci/archive/20220315/[email protected]/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install mips cross compiling tool for clang build # apt-get install binutils-mips-linux-gnu # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=8d60400704e503ded9f0c2ea32c2303d22955888 git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout 8d60400704e503ded9f0c2ea32c2303d22955888 # save the config file to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips clang-analyzer If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> clang-analyzer warnings: (new ones prefixed by >>) kernel/rcu/rcuscale.c:431:3: note: Taking true branch if (gp_async) { ^ kernel/rcu/rcuscale.c:433:9: note: 'rhp' is non-null if (!rhp) ^~~ kernel/rcu/rcuscale.c:433:4: note: Taking false branch if (!rhp) ^ kernel/rcu/rcuscale.c:435:8: note: 'rhp' is non-null if (rhp && atomic_read(this_cpu_ptr(&n_async_inflight)) < gp_async_max) { ^~~ kernel/rcu/rcuscale.c:435:8: note: Left side of '&&' is true kernel/rcu/rcuscale.c:435:27: note: Loop condition is false. Exiting loop if (rhp && atomic_read(this_cpu_ptr(&n_async_inflight)) < gp_async_max) { ^ include/linux/percpu-defs.h:265:27: note: expanded from macro 'this_cpu_ptr' #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) ^ include/linux/percpu-defs.h:264:26: note: expanded from macro 'raw_cpu_ptr' #define raw_cpu_ptr(ptr) per_cpu_ptr(ptr, 0) ^ include/linux/percpu-defs.h:263:47: note: expanded from macro 'per_cpu_ptr' #define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); VERIFY_PERCPU_PTR(ptr); }) ^ include/linux/percpu-defs.h:259:2: note: expanded from macro 'VERIFY_PERCPU_PTR' __verify_pcpu_ptr(__p); \ ^ include/linux/percpu-defs.h:217:37: note: expanded from macro '__verify_pcpu_ptr' #define __verify_pcpu_ptr(ptr) \ ^ kernel/rcu/rcuscale.c:435:15: note: Assuming the condition is false if (rhp && atomic_read(this_cpu_ptr(&n_async_inflight)) < gp_async_max) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/rcu/rcuscale.c:435:4: note: Taking false branch if (rhp && atomic_read(this_cpu_ptr(&n_async_inflight)) < gp_async_max) { ^ kernel/rcu/rcuscale.c:439:15: note: Assuming the condition is false } else if (!kthread_should_stop()) { ^~~~~~~~~~~~~~~~~~~~~~ kernel/rcu/rcuscale.c:439:11: note: Taking false branch } else if (!kthread_should_stop()) { ^ kernel/rcu/rcuscale.c:443:5: note: Attempt to free released memory kfree(rhp); /* Because we are stopping. */ ^~~~~~~~~~ Suppressed 1 warnings (1 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 1 warning generated. Suppressed 1 warnings (1 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 1 warning generated. Suppressed 1 warnings (1 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 1 warning generated. Suppressed 1 warnings (1 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 1 warning generated. Suppressed 1 warnings (1 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 1 warning generated. Suppressed 1 warnings (1 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 1 warning generated. Suppressed 1 warnings (1 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 1 warning generated. Suppressed 1 warnings (1 with check filters). 1 warning generated. Suppressed 1 warnings (1 with check filters). 2 warnings generated. Suppressed 2 warnings (1 in non-user code, 1 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 1 warning generated. Suppressed 1 warnings (1 with check filters). 2 warnings generated. Suppressed 2 warnings (1 in non-user code, 1 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 1 warning generated. Suppressed 1 warnings (1 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 1 warning generated. Suppressed 1 warnings (1 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 1 warning generated. Suppressed 1 warnings (1 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 1 warning generated. Suppressed 1 warnings (1 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (1 in non-user code, 2 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 134 warnings generated. >> lib/stackinit_kunit.c:259:8: warning: Excessive padding in 'struct >> test_big_hole' (124 padding bytes, where 60 is optimal). Optimal fields order: four, one, two, three, consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding] struct test_big_hole { ~~~~~~~^~~~~~~~~~~~~~~ lib/stackinit_kunit.c:259:8: note: Excessive padding in 'struct test_big_hole' (124 padding bytes, where 60 is optimal). Optimal fields order: four, one, two, three, consider reordering the fields or adding explicit padding members struct test_big_hole { ~~~~~~~^~~~~~~~~~~~~~~ >> lib/stackinit_kunit.c:333:1: warning: Address of stack memory associated >> with local variable 'var' is still referred to by the global variable >> 'fill_start' upon returning to the caller. This will be a dangling >> reference [clang-analyzer-core.StackAddressEscape] DEFINE_SCALAR_TESTS(zero, ALWAYS_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^ lib/stackinit_kunit.c:237:2: note: expanded from macro 'DEFINE_TEST' return (int)buf[0] | (int)buf[sizeof(buf) - 1]; \ ^ lib/stackinit_kunit.c:333:1: note: Taking false branch DEFINE_SCALAR_TESTS(zero, ALWAYS_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^ lib/stackinit_kunit.c:238:10: note: expanded from macro 'DEFINE_TEST' } \ ^ note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/compiler_types.h:346:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:334:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:326:3: note: expanded from macro '__compiletime_assert' if (!(condition)) \ ^ lib/stackinit_kunit.c:333:1: note: Loop condition is false. Exiting loop DEFINE_SCALAR_TESTS(zero, ALWAYS_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^ lib/stackinit_kunit.c:238:10: note: expanded from macro 'DEFINE_TEST' } \ ^ note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/compiler_types.h:346:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:334:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:318:2: note: expanded from macro '__compiletime_assert' do { \ ^ lib/stackinit_kunit.c:333:1: note: Calling 'leaf_u8_zero' DEFINE_SCALAR_TESTS(zero, ALWAYS_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:238:10: note: expanded from macro 'DEFINE_TEST' } \ ^ lib/stackinit_kunit.c:163:12: note: expanded from macro '\DEFINE_TEST_DRIVER' ignored = leaf_ ##name((unsigned long)&ignored, 1, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note: expanded from here lib/stackinit_kunit.c:333:1: note: 'fill' is true DEFINE_SCALAR_TESTS(zero, ALWAYS_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:223:6: note: expanded from macro 'DEFINE_TEST' if (fill) { \ ^~~~ lib/stackinit_kunit.c:333:1: note: Taking true branch DEFINE_SCALAR_TESTS(zero, ALWAYS_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^ lib/stackinit_kunit.c:223:2: note: expanded from macro 'DEFINE_TEST' if (fill) { \ ^ lib/stackinit_kunit.c:333:1: note: Address of stack memory associated with local variable 'var' is still referred to by the global variable 'fill_start' upon returning to the caller. This will be a dangling reference DEFINE_SCALAR_TESTS(zero, ALWAYS_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:237:2: note: expanded from macro 'DEFINE_TEST' return (int)buf[0] | (int)buf[sizeof(buf) - 1]; \ ^ >> lib/stackinit_kunit.c:333:1: warning: Address of stack memory associated >> with local variable 'var' is still referred to by the global variable >> 'target_start' upon returning to the caller. This will be a dangling >> reference [clang-analyzer-core.StackAddressEscape] DEFINE_SCALAR_TESTS(zero, ALWAYS_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^ lib/stackinit_kunit.c:237:2: note: expanded from macro 'DEFINE_TEST' return (int)buf[0] | (int)buf[sizeof(buf) - 1]; \ ^ lib/stackinit_kunit.c:333:1: note: Taking false branch DEFINE_SCALAR_TESTS(zero, ALWAYS_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^ lib/stackinit_kunit.c:238:10: note: expanded from macro 'DEFINE_TEST' } \ ^ note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/compiler_types.h:346:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:334:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:326:3: note: expanded from macro '__compiletime_assert' if (!(condition)) \ ^ lib/stackinit_kunit.c:333:1: note: Loop condition is false. Exiting loop DEFINE_SCALAR_TESTS(zero, ALWAYS_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^ lib/stackinit_kunit.c:238:10: note: expanded from macro 'DEFINE_TEST' } \ ^ note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/compiler_types.h:346:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:334:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:318:2: note: expanded from macro '__compiletime_assert' do { \ ^ lib/stackinit_kunit.c:333:1: note: Calling 'leaf_u8_zero' DEFINE_SCALAR_TESTS(zero, ALWAYS_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:238:10: note: expanded from macro 'DEFINE_TEST' } \ ^ lib/stackinit_kunit.c:163:12: note: expanded from macro '\DEFINE_TEST_DRIVER' ignored = leaf_ ##name((unsigned long)&ignored, 1, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note: expanded from here lib/stackinit_kunit.c:333:1: note: 'fill' is true DEFINE_SCALAR_TESTS(zero, ALWAYS_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:223:6: note: expanded from macro 'DEFINE_TEST' if (fill) { \ ^~~~ lib/stackinit_kunit.c:333:1: note: Taking true branch DEFINE_SCALAR_TESTS(zero, ALWAYS_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^ lib/stackinit_kunit.c:223:2: note: expanded from macro 'DEFINE_TEST' if (fill) { \ ^ lib/stackinit_kunit.c:333:1: note: Address of stack memory associated with local variable 'var' is still referred to by the global variable 'target_start' upon returning to the caller. This will be a dangling reference DEFINE_SCALAR_TESTS(zero, ALWAYS_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ -- ^ lib/stackinit_kunit.c:237:2: note: expanded from macro 'DEFINE_TEST' return (int)buf[0] | (int)buf[sizeof(buf) - 1]; \ ^ lib/stackinit_kunit.c:343:1: note: Taking false branch DEFINE_SCALAR_TESTS(none, STRONG_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^ lib/stackinit_kunit.c:238:10: note: expanded from macro 'DEFINE_TEST' } \ ^ note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/compiler_types.h:346:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:334:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:326:3: note: expanded from macro '__compiletime_assert' if (!(condition)) \ ^ lib/stackinit_kunit.c:343:1: note: Loop condition is false. Exiting loop DEFINE_SCALAR_TESTS(none, STRONG_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^ lib/stackinit_kunit.c:238:10: note: expanded from macro 'DEFINE_TEST' } \ ^ note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/compiler_types.h:346:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:334:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:318:2: note: expanded from macro '__compiletime_assert' do { \ ^ lib/stackinit_kunit.c:343:1: note: Calling 'leaf_u8_none' DEFINE_SCALAR_TESTS(none, STRONG_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:238:10: note: expanded from macro 'DEFINE_TEST' } \ ^ lib/stackinit_kunit.c:163:12: note: expanded from macro '\DEFINE_TEST_DRIVER' ignored = leaf_ ##name((unsigned long)&ignored, 1, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note: expanded from here lib/stackinit_kunit.c:343:1: note: 'fill' is true DEFINE_SCALAR_TESTS(none, STRONG_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:223:6: note: expanded from macro 'DEFINE_TEST' if (fill) { \ ^~~~ lib/stackinit_kunit.c:343:1: note: Taking true branch DEFINE_SCALAR_TESTS(none, STRONG_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^ lib/stackinit_kunit.c:223:2: note: expanded from macro 'DEFINE_TEST' if (fill) { \ ^ lib/stackinit_kunit.c:343:1: note: Address of stack memory associated with local variable 'var' is still referred to by the global variable 'target_start' upon returning to the caller. This will be a dangling reference DEFINE_SCALAR_TESTS(none, STRONG_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:237:2: note: expanded from macro 'DEFINE_TEST' return (int)buf[0] | (int)buf[sizeof(buf) - 1]; \ ^ >> lib/stackinit_kunit.c:343:1: warning: Undefined or garbage value returned to >> caller [clang-analyzer-core.uninitialized.UndefReturn] DEFINE_SCALAR_TESTS(none, STRONG_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^ lib/stackinit_kunit.c:204:3: note: expanded from macro 'DEFINE_TEST' return DO_NOTHING_RETURN_ ## which(ptr); \ ^ lib/stackinit_kunit.c:343:1: note: Taking false branch DEFINE_SCALAR_TESTS(none, STRONG_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^ lib/stackinit_kunit.c:238:10: note: expanded from macro 'DEFINE_TEST' } \ ^ note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/compiler_types.h:346:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:334:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:326:3: note: expanded from macro '__compiletime_assert' if (!(condition)) \ ^ lib/stackinit_kunit.c:343:1: note: Loop condition is false. Exiting loop DEFINE_SCALAR_TESTS(none, STRONG_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^ lib/stackinit_kunit.c:238:10: note: expanded from macro 'DEFINE_TEST' } \ ^ note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/compiler_types.h:346:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:334:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:318:2: note: expanded from macro '__compiletime_assert' do { \ ^ lib/stackinit_kunit.c:343:1: note: Loop condition is true. Entering loop body DEFINE_SCALAR_TESTS(none, STRONG_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^ lib/stackinit_kunit.c:238:10: note: expanded from macro 'DEFINE_TEST' } \ ^ lib/stackinit_kunit.c:166:2: note: expanded from macro '\DEFINE_TEST_DRIVER' for (sum = 0, i = 0; i < target_size; i++) \ ^ lib/stackinit_kunit.c:343:1: note: Assuming the condition is false DEFINE_SCALAR_TESTS(none, STRONG_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:238:10: note: expanded from macro 'DEFINE_TEST' } \ ^ lib/stackinit_kunit.c:167:11: note: expanded from macro '\DEFINE_TEST_DRIVER' sum += (check_buf[i] != 0xFF); \ ^~~~~~~~~~~~~~~~~~~~ lib/stackinit_kunit.c:343:1: note: Loop condition is false. Execution continues on line 343 DEFINE_SCALAR_TESTS(none, STRONG_PASS); ^ lib/stackinit_kunit.c:309:3: note: expanded from macro 'DEFINE_SCALAR_TESTS' DEFINE_SCALAR_TEST(u8, init, xfail); \ ^ lib/stackinit_kunit.c:305:3: note: expanded from macro 'DEFINE_SCALAR_TEST' DEFINE_TEST(name ## _ ## init, name, SCALAR, \ ^ lib/stackinit_kunit.c:238:10: note: expanded from macro 'DEFINE_TEST' } \ ^ lib/stackinit_kunit.c:166:2: note: expanded from macro '\DEFINE_TEST_DRIVER' for (sum = 0, i = 0; i < target_size; i++) \ ^ vim +259 lib/stackinit_kunit.c 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 257 f9398f15605a501 lib/test_stackinit.c Kees Cook 2021-07-23 258 /* Trigger unhandled padding in a structure. */ 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 @259 struct test_big_hole { 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 260 u8 one; 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 261 u8 two; 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 262 u8 three; 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 263 /* 61 byte padding hole here. */ f9398f15605a501 lib/test_stackinit.c Kees Cook 2021-07-23 264 u8 four __aligned(64); 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 265 } __aligned(64); 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 266 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 267 struct test_trailing_hole { 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 268 char *one; 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 269 char *two; 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 270 char *three; 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 271 char four; 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 272 /* "sizeof(unsigned long) - 1" byte padding hole here. */ 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 273 }; 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 274 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 275 /* Test if STRUCTLEAK is clearing structs with __user fields. */ 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 276 struct test_user { 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 277 u8 one; 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 278 unsigned long two; 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 279 char __user *three; 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 280 unsigned long four; 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 281 }; 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 282 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 283 #define ALWAYS_PASS WANT_SUCCESS 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 284 #define ALWAYS_FAIL XFAIL 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 285 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 286 #ifdef CONFIG_INIT_STACK_NONE 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 287 # define USER_PASS XFAIL 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 288 # define BYREF_PASS XFAIL 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 289 # define STRONG_PASS XFAIL 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 290 #elif defined(CONFIG_GCC_PLUGIN_STRUCTLEAK_USER) 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 291 # define USER_PASS WANT_SUCCESS 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 292 # define BYREF_PASS XFAIL 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 293 # define STRONG_PASS XFAIL 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 294 #elif defined(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF) 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 295 # define USER_PASS WANT_SUCCESS 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 296 # define BYREF_PASS WANT_SUCCESS 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 297 # define STRONG_PASS XFAIL 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 298 #else 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 299 # define USER_PASS WANT_SUCCESS 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 300 # define BYREF_PASS WANT_SUCCESS 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 301 # define STRONG_PASS WANT_SUCCESS 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 302 #endif 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 303 a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 304 #define DEFINE_SCALAR_TEST(name, init, xfail) \ a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 305 DEFINE_TEST(name ## _ ## init, name, SCALAR, \ a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 306 init, xfail) 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 307 a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 308 #define DEFINE_SCALAR_TESTS(init, xfail) \ a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 309 DEFINE_SCALAR_TEST(u8, init, xfail); \ a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 310 DEFINE_SCALAR_TEST(u16, init, xfail); \ a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 311 DEFINE_SCALAR_TEST(u32, init, xfail); \ a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 312 DEFINE_SCALAR_TEST(u64, init, xfail); \ a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 313 DEFINE_TEST(char_array_ ## init, unsigned char, \ a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 314 STRING, init, xfail) 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 315 a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 316 #define DEFINE_STRUCT_TEST(name, init, xfail) \ 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 317 DEFINE_TEST(name ## _ ## init, \ a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 318 struct test_ ## name, STRUCT, init, \ a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 319 xfail) a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 320 a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 321 #define DEFINE_STRUCT_TESTS(init, xfail) \ a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 322 DEFINE_STRUCT_TEST(small_hole, init, xfail); \ a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 323 DEFINE_STRUCT_TEST(big_hole, init, xfail); \ a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 324 DEFINE_STRUCT_TEST(trailing_hole, init, xfail); \ a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 325 DEFINE_STRUCT_TEST(packed, init, xfail) 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 326 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 327 #define DEFINE_STRUCT_INITIALIZER_TESTS(base, xfail) \ a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 328 DEFINE_STRUCT_TESTS(base ## _ ## partial, \ 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 329 xfail); \ 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 330 DEFINE_STRUCT_TESTS(base ## _ ## all, xfail) 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 331 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 332 /* These should be fully initialized all the time! */ 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 @333 DEFINE_SCALAR_TESTS(zero, ALWAYS_PASS); 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 334 DEFINE_STRUCT_TESTS(zero, ALWAYS_PASS); a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 335 /* Struct initializers: padding may be left uninitialized. */ 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 336 DEFINE_STRUCT_INITIALIZER_TESTS(static, STRONG_PASS); 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 337 DEFINE_STRUCT_INITIALIZER_TESTS(dynamic, STRONG_PASS); 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 338 DEFINE_STRUCT_INITIALIZER_TESTS(runtime, STRONG_PASS); 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 339 DEFINE_STRUCT_INITIALIZER_TESTS(assigned_static, STRONG_PASS); 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 340 DEFINE_STRUCT_INITIALIZER_TESTS(assigned_dynamic, STRONG_PASS); 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 341 DEFINE_STRUCT_TESTS(assigned_copy, ALWAYS_FAIL); 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 342 /* No initialization without compiler instrumentation. */ 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 @343 DEFINE_SCALAR_TESTS(none, STRONG_PASS); 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 344 DEFINE_STRUCT_TESTS(none, BYREF_PASS); a8fc576d4af2f23 lib/test_stackinit.c Kees Cook 2021-07-23 345 /* Initialization of members with __user attribute. */ 8d60400704e503d lib/stackinit_kunit.c Kees Cook 2022-02-16 346 DEFINE_TEST(user, struct test_user, STRUCT, none, USER_PASS); 50ceaa95ea09703 lib/test_stackinit.c Kees Cook 2019-01-23 347 :::::: The code at line 259 was first introduced by commit :::::: 50ceaa95ea09703722b30b4afa617c972071cd7f lib: Introduce test_stackinit module :::::: TO: Kees Cook <[email protected]> :::::: CC: Kees Cook <[email protected]> --- 0-DAY CI Kernel Test Service https://lists.01.org/hyperkitty/list/[email protected] _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
