public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Josef Bacik <josef@toxicpanda.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	David Sterba <dsterba@suse.com>, Qu Wenruo <wqu@suse.com>
Subject: include/linux/kasan-checks.h:38:27: warning: 'label' may be used uninitialized
Date: Sat, 30 Nov 2024 08:56:17 +0800	[thread overview]
Message-ID: <202411300855.sRB49hum-lkp@intel.com> (raw)

Hi Josef,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2ba9f676d0a2e408aef14d679984c26373bf37b7
commit: 1ec49744ba83f0429c5c706708610f7821a7b6f4 btrfs: turn on -Wmaybe-uninitialized
date:   1 year, 10 months ago
config: arm64-randconfig-001-20241120 (https://download.01.org/0day-ci/archive/20241130/202411300855.sRB49hum-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241130/202411300855.sRB49hum-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411300855.sRB49hum-lkp@intel.com/

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:26,
                    from arch/arm64/include/asm/rwonce.h:71,
                    from include/linux/compiler.h:247,
                    from include/linux/export.h:33,
                    from include/linux/linkage.h:7,
                    from include/linux/kernel.h:17,
                    from fs/btrfs/ioctl.c:6:
   In function 'instrument_copy_from_user_before',
       inlined from '_copy_from_user' at include/linux/uaccess.h:126:3,
       inlined from 'copy_from_user' at include/linux/uaccess.h:161:7,
       inlined from 'btrfs_ioctl_set_fslabel' at fs/btrfs/ioctl.c:4112:6:
>> include/linux/kasan-checks.h:38:27: warning: 'label' may be used uninitialized [-Wmaybe-uninitialized]
      38 | #define kasan_check_write __kasan_check_write
   include/linux/instrumented.h:137:9: note: in expansion of macro 'kasan_check_write'
     137 |         kasan_check_write(to, n);
         |         ^~~~~~~~~~~~~~~~~
   include/linux/kasan-checks.h: In function 'btrfs_ioctl_set_fslabel':
   include/linux/kasan-checks.h:20:6: note: by argument 1 of type 'const volatile void *' to '__kasan_check_write' declared here
      20 | bool __kasan_check_write(const volatile void *p, unsigned int size);
         |      ^~~~~~~~~~~~~~~~~~~
   fs/btrfs/ioctl.c:4106:14: note: 'label' declared here
    4106 |         char label[BTRFS_LABEL_SIZE];
         |              ^~~~~
   In function 'instrument_copy_from_user_before',
       inlined from '_copy_from_user' at include/linux/uaccess.h:126:3,
       inlined from 'copy_from_user' at include/linux/uaccess.h:161:7,
       inlined from 'btrfs_ioctl_wait_sync' at fs/btrfs/ioctl.c:3137:7:
   include/linux/kasan-checks.h:38:27: warning: 'transid' may be used uninitialized [-Wmaybe-uninitialized]
      38 | #define kasan_check_write __kasan_check_write
   include/linux/instrumented.h:137:9: note: in expansion of macro 'kasan_check_write'
     137 |         kasan_check_write(to, n);
         |         ^~~~~~~~~~~~~~~~~
   include/linux/kasan-checks.h: In function 'btrfs_ioctl_wait_sync':
   include/linux/kasan-checks.h:20:6: note: by argument 1 of type 'const volatile void *' to '__kasan_check_write' declared here
      20 | bool __kasan_check_write(const volatile void *p, unsigned int size);
         |      ^~~~~~~~~~~~~~~~~~~
   fs/btrfs/ioctl.c:3134:13: note: 'transid' declared here
    3134 |         u64 transid;
         |             ^~~~~~~
   In function 'instrument_copy_from_user_before',
       inlined from '_copy_from_user' at include/linux/uaccess.h:126:3,
       inlined from 'copy_from_user' at include/linux/uaccess.h:161:7,
       inlined from 'btrfs_ioctl_tree_search' at fs/btrfs/ioctl.c:1740:6:
   include/linux/kasan-checks.h:38:27: warning: 'sk' may be used uninitialized [-Wmaybe-uninitialized]
      38 | #define kasan_check_write __kasan_check_write
   include/linux/instrumented.h:137:9: note: in expansion of macro 'kasan_check_write'
     137 |         kasan_check_write(to, n);
         |         ^~~~~~~~~~~~~~~~~
   include/linux/kasan-checks.h: In function 'btrfs_ioctl_tree_search':
   include/linux/kasan-checks.h:20:6: note: by argument 1 of type 'const volatile void *' to '__kasan_check_write' declared here
      20 | bool __kasan_check_write(const volatile void *p, unsigned int size);
         |      ^~~~~~~~~~~~~~~~~~~
   fs/btrfs/ioctl.c:1733:39: note: 'sk' declared here
    1733 |         struct btrfs_ioctl_search_key sk;
         |                                       ^~
   In function 'instrument_copy_from_user_before',
       inlined from '_copy_from_user' at include/linux/uaccess.h:126:3,
       inlined from 'copy_from_user' at include/linux/uaccess.h:161:7,
       inlined from 'btrfs_ioctl_set_features' at fs/btrfs/ioctl.c:4256:6:
>> include/linux/kasan-checks.h:38:27: warning: 'flags' may be used uninitialized [-Wmaybe-uninitialized]
      38 | #define kasan_check_write __kasan_check_write
   include/linux/instrumented.h:137:9: note: in expansion of macro 'kasan_check_write'
     137 |         kasan_check_write(to, n);
         |         ^~~~~~~~~~~~~~~~~
   include/linux/kasan-checks.h: In function 'btrfs_ioctl_set_features':
   include/linux/kasan-checks.h:20:6: note: by argument 1 of type 'const volatile void *' to '__kasan_check_write' declared here
      20 | bool __kasan_check_write(const volatile void *p, unsigned int size);
         |      ^~~~~~~~~~~~~~~~~~~
   fs/btrfs/ioctl.c:4248:42: note: 'flags' declared here
    4248 |         struct btrfs_ioctl_feature_flags flags[2];
         |                                          ^~~~~
   In function 'instrument_copy_from_user_before',
       inlined from '_copy_from_user' at include/linux/uaccess.h:126:3,
       inlined from 'copy_from_user' at include/linux/uaccess.h:161:7,
       inlined from 'btrfs_ioctl_tree_search_v2' at fs/btrfs/ioctl.c:1772:6:
   include/linux/kasan-checks.h:38:27: warning: 'args' may be used uninitialized [-Wmaybe-uninitialized]
      38 | #define kasan_check_write __kasan_check_write
   include/linux/instrumented.h:137:9: note: in expansion of macro 'kasan_check_write'
     137 |         kasan_check_write(to, n);
         |         ^~~~~~~~~~~~~~~~~
   include/linux/kasan-checks.h: In function 'btrfs_ioctl_tree_search_v2':
   include/linux/kasan-checks.h:20:6: note: by argument 1 of type 'const volatile void *' to '__kasan_check_write' declared here
      20 | bool __kasan_check_write(const volatile void *p, unsigned int size);
         |      ^~~~~~~~~~~~~~~~~~~
   fs/btrfs/ioctl.c:1763:43: note: 'args' declared here
    1763 |         struct btrfs_ioctl_search_args_v2 args;
         |                                           ^~~~
   In function 'instrument_copy_from_user_before',
       inlined from '_copy_from_user' at include/linux/uaccess.h:126:3,
       inlined from 'copy_from_user' at include/linux/uaccess.h:161:7,
       inlined from 'btrfs_ioctl_space_info' at fs/btrfs/ioctl.c:2991:6:
   include/linux/kasan-checks.h:38:27: warning: 'space_args' may be used uninitialized [-Wmaybe-uninitialized]
      38 | #define kasan_check_write __kasan_check_write
   include/linux/instrumented.h:137:9: note: in expansion of macro 'kasan_check_write'
     137 |         kasan_check_write(to, n);
         |         ^~~~~~~~~~~~~~~~~
   include/linux/kasan-checks.h: In function 'btrfs_ioctl_space_info':
   include/linux/kasan-checks.h:20:6: note: by argument 1 of type 'const volatile void *' to '__kasan_check_write' declared here
      20 | bool __kasan_check_write(const volatile void *p, unsigned int size);
         |      ^~~~~~~~~~~~~~~~~~~
   fs/btrfs/ioctl.c:2973:39: note: 'space_args' declared here
    2973 |         struct btrfs_ioctl_space_args space_args;
         |                                       ^~~~~~~~~~
   In function 'instrument_copy_from_user_before',
       inlined from '_copy_from_user' at include/linux/uaccess.h:126:3,
       inlined from 'copy_from_user' at include/linux/uaccess.h:161:7,
       inlined from 'btrfs_ioctl_encoded_write.constprop' at fs/btrfs/ioctl.c:4473:7:
   include/linux/kasan-checks.h:38:27: warning: 'args' may be used uninitialized [-Wmaybe-uninitialized]
      38 | #define kasan_check_write __kasan_check_write
   include/linux/instrumented.h:137:9: note: in expansion of macro 'kasan_check_write'
     137 |         kasan_check_write(to, n);
         |         ^~~~~~~~~~~~~~~~~
   include/linux/kasan-checks.h: In function 'btrfs_ioctl_encoded_write.constprop':
   include/linux/kasan-checks.h:20:6: note: by argument 1 of type 'const volatile void *' to '__kasan_check_write' declared here
      20 | bool __kasan_check_write(const volatile void *p, unsigned int size);
         |      ^~~~~~~~~~~~~~~~~~~
   fs/btrfs/ioctl.c:4433:44: note: 'args' declared here
    4433 |         struct btrfs_ioctl_encoded_io_args args;
         |                                            ^~~~


vim +/label +38 include/linux/kasan-checks.h

7d8ad890dad00f Marco Elver     2019-07-11  31  
7d8ad890dad00f Marco Elver     2019-07-11  32  /*
7d8ad890dad00f Marco Elver     2019-07-11  33   * kasan_check_*: Only available when the particular compilation unit has KASAN
7d8ad890dad00f Marco Elver     2019-07-11  34   * instrumentation enabled. May be used in header files.
7d8ad890dad00f Marco Elver     2019-07-11  35   */
7d8ad890dad00f Marco Elver     2019-07-11  36  #ifdef __SANITIZE_ADDRESS__
7d8ad890dad00f Marco Elver     2019-07-11  37  #define kasan_check_read __kasan_check_read
7d8ad890dad00f Marco Elver     2019-07-11 @38  #define kasan_check_write __kasan_check_write
64f8ebaf115bcd Andrey Ryabinin 2016-05-20  39  #else
b5f6e0fc7d60e0 Marco Elver     2019-07-11  40  static inline bool kasan_check_read(const volatile void *p, unsigned int size)
b5f6e0fc7d60e0 Marco Elver     2019-07-11  41  {
b5f6e0fc7d60e0 Marco Elver     2019-07-11  42  	return true;
b5f6e0fc7d60e0 Marco Elver     2019-07-11  43  }
b5f6e0fc7d60e0 Marco Elver     2019-07-11  44  static inline bool kasan_check_write(const volatile void *p, unsigned int size)
b5f6e0fc7d60e0 Marco Elver     2019-07-11  45  {
b5f6e0fc7d60e0 Marco Elver     2019-07-11  46  	return true;
b5f6e0fc7d60e0 Marco Elver     2019-07-11  47  }
64f8ebaf115bcd Andrey Ryabinin 2016-05-20  48  #endif
64f8ebaf115bcd Andrey Ryabinin 2016-05-20  49  

:::::: The code at line 38 was first introduced by commit
:::::: 7d8ad890dad00f6cd64bfb44d9be4fceb10cf819 mm/kasan: introduce __kasan_check_{read,write}

:::::: TO: Marco Elver <elver@google.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

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

                 reply	other threads:[~2024-11-30  0:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202411300855.sRB49hum-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=wqu@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox