include/linux/kcsan-checks.h:220:28: warning: 'args32' may be used uninitialized

From: kernel test robot
Date: Tue Jul 25 2023 - 15:05:17 EST


Hi Josef,

FYI, the error/warning still remains.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0b5547c51827e053cc754db47d3ec3e6c2c451d2
commit: 1ec49744ba83f0429c5c706708610f7821a7b6f4 btrfs: turn on -Wmaybe-uninitialized
date: 5 months ago
config: s390-randconfig-m041-20230725 (https://download.01.org/0day-ci/archive/20230726/202307260230.9fX7alLc-lkp@xxxxxxxxx/config)
compiler: s390-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230726/202307260230.9fX7alLc-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307260230.9fX7alLc-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/asm-generic/rwonce.h:27,
from ./arch/s390/include/generated/asm/rwonce.h:1,
from include/linux/compiler.h:247,
from include/linux/kernel.h:20,
from fs/btrfs/ioctl.c:6:
include/linux/kcsan-checks.h: In function 'btrfs_ioctl_wait_sync':
include/linux/kcsan-checks.h:220:28: warning: 'transid' may be used uninitialized [-Wmaybe-uninitialized]
220 | #define kcsan_check_access __kcsan_check_access
| ^~~~~~~~~~~~~~~~~~~~
include/linux/kcsan-checks.h:37:6: note: by argument 1 of type 'const volatile void *' to '__kcsan_check_access' declared here
37 | void __kcsan_check_access(const volatile void *ptr, size_t size, int type);
| ^~~~~~~~~~~~~~~~~~~~
fs/btrfs/ioctl.c:3134:13: note: 'transid' declared here
3134 | u64 transid;
| ^~~~~~~
include/linux/kcsan-checks.h: In function 'btrfs_ioctl_space_info':
include/linux/kcsan-checks.h:220:28: warning: 'space_args' may be used uninitialized [-Wmaybe-uninitialized]
220 | #define kcsan_check_access __kcsan_check_access
| ^~~~~~~~~~~~~~~~~~~~
include/linux/kcsan-checks.h:37:6: note: by argument 1 of type 'const volatile void *' to '__kcsan_check_access' declared here
37 | void __kcsan_check_access(const volatile void *ptr, size_t size, int type);
| ^~~~~~~~~~~~~~~~~~~~
fs/btrfs/ioctl.c:2973:39: note: 'space_args' declared here
2973 | struct btrfs_ioctl_space_args space_args;
| ^~~~~~~~~~
include/linux/kcsan-checks.h: In function 'btrfs_ioctl':
>> include/linux/kcsan-checks.h:220:28: warning: 'args32' may be used uninitialized [-Wmaybe-uninitialized]
220 | #define kcsan_check_access __kcsan_check_access
| ^~~~~~~~~~~~~~~~~~~~
include/linux/kcsan-checks.h:37:6: note: by argument 1 of type 'const volatile void *' to '__kcsan_check_access' declared here
37 | void __kcsan_check_access(const volatile void *ptr, size_t size, int type);
| ^~~~~~~~~~~~~~~~~~~~
fs/btrfs/ioctl.c:4320:49: note: 'args32' declared here
4320 | struct btrfs_ioctl_send_args_32 args32;
| ^~~~~~


vim +/args32 +220 include/linux/kcsan-checks.h

dfd402a4c4baae Marco Elver 2019-11-14 214
19acd03d95dad1 Marco Elver 2020-04-24 215 #ifdef __SANITIZE_THREAD__
dfd402a4c4baae Marco Elver 2019-11-14 216 /*
19acd03d95dad1 Marco Elver 2020-04-24 217 * Only calls into the runtime when the particular compilation unit has KCSAN
19acd03d95dad1 Marco Elver 2020-04-24 218 * instrumentation enabled. May be used in header files.
dfd402a4c4baae Marco Elver 2019-11-14 219 */
dfd402a4c4baae Marco Elver 2019-11-14 @220 #define kcsan_check_access __kcsan_check_access
19acd03d95dad1 Marco Elver 2020-04-24 221

:::::: The code at line 220 was first introduced by commit
:::::: dfd402a4c4baae42398ce9180ff424d589b8bffc kcsan: Add Kernel Concurrency Sanitizer infrastructure

:::::: TO: Marco Elver <elver@xxxxxxxxxx>
:::::: CC: Paul E. McKenney <paulmck@xxxxxxxxxx>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki