From: kernel test robot <lkp@intel.com>
To: Qing Zhang <zhangqing@loongson.cn>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Huacai Chen <chenhuacai@kernel.org>
Subject: include/linux/kasan-checks.h:38:27: warning: 'space_args' may be used uninitialized
Date: Sat, 16 Sep 2023 04:42:35 +0800 [thread overview]
Message-ID: <202309160440.jECtzdr6-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9fdfb15a3dbf818e06be514f4abbfc071004cbe7
commit: 5aa4ac64e6add3e40d5049e31275b2822daf885d LoongArch: Add KASAN (Kernel Address Sanitizer) support
date: 9 days ago
config: loongarch-randconfig-002-20230916 (https://download.01.org/0day-ci/archive/20230916/202309160440.jECtzdr6-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230916/202309160440.jECtzdr6-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/202309160440.jECtzdr6-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/loongarch/include/generated/asm/rwonce.h:1,
from include/linux/compiler.h:246,
from include/linux/export.h:5,
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:148:3,
inlined from 'copy_from_user' at include/linux/uaccess.h:183:7,
inlined from 'btrfs_ioctl_space_info' at fs/btrfs/ioctl.c:2993: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:129:9: note: in expansion of macro 'kasan_check_write'
129 | 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:2975:39: note: 'space_args' declared here
2975 | struct btrfs_ioctl_space_args space_args;
| ^~~~~~~~~~
vim +/space_args +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:[~2023-09-15 20:44 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=202309160440.jECtzdr6-lkp@intel.com \
--to=lkp@intel.com \
--cc=chenhuacai@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=zhangqing@loongson.cn \
/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