tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 13b424f97ef548612c760cfd0892f96de96707e0 commit: b9f356e64a7eda411ba8b63df9d4c5e204f16025 [23662/23701] block-io-hierarchy: core hierarchy iodump implementation config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20240906/202409061840.VkS4KqE5-lkp@i...) compiler: aarch64-linux-gcc (GCC) 14.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240906/202409061840.VkS4KqE5-lkp@i...)
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/202409061840.VkS4KqE5-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/preempt.h:5, from ./arch/arm64/include/generated/asm/preempt.h:1, from include/linux/preempt.h:81, from include/linux/spinlock.h:51, from include/linux/wait.h:9, from include/linux/wait_bit.h:8, from include/linux/fs.h:7, from include/linux/seq_file.h:11, from block/blk-io-hierarchy/iodump.c:14: In function 'check_object_size', inlined from 'check_copy_size' at include/linux/thread_info.h:90:2, inlined from 'copy_from_user' at include/linux/uaccess.h:143:6, inlined from 'threshold_store' at block/blk-io-hierarchy/iodump.c:240:6:
include/linux/thread_info.h:59:17: warning: 'b' may be used uninitialized [-Wmaybe-uninitialized]
59 | __check_object_size(ptr, n, to_user); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/thread_info.h: In function 'threshold_store': include/linux/thread_info.h:52:13: note: by argument 1 of type 'const void *' to '__check_object_size' declared here 52 | extern void __check_object_size(const void *ptr, unsigned long n, | ^~~~~~~~~~~~~~~~~~~ block/blk-io-hierarchy/iodump.c:234:14: note: 'b' declared here 234 | char b[MAX_BUF_LEN + 1]; | ^
vim +/b +59 include/linux/thread_info.h
0f60a8efe4005ab Kees Cook 2016-07-12 50 f5509cc18daa7f8 Kees Cook 2016-06-07 51 #ifdef CONFIG_HARDENED_USERCOPY f5509cc18daa7f8 Kees Cook 2016-06-07 52 extern void __check_object_size(const void *ptr, unsigned long n, f5509cc18daa7f8 Kees Cook 2016-06-07 53 bool to_user); f5509cc18daa7f8 Kees Cook 2016-06-07 54 a85d6b8242dc78e Kees Cook 2016-09-07 55 static __always_inline void check_object_size(const void *ptr, unsigned long n, f5509cc18daa7f8 Kees Cook 2016-06-07 56 bool to_user) f5509cc18daa7f8 Kees Cook 2016-06-07 57 { 81409e9e2805881 Kees Cook 2016-08-31 58 if (!__builtin_constant_p(n)) f5509cc18daa7f8 Kees Cook 2016-06-07 @59 __check_object_size(ptr, n, to_user); f5509cc18daa7f8 Kees Cook 2016-06-07 60 } f5509cc18daa7f8 Kees Cook 2016-06-07 61 #else f5509cc18daa7f8 Kees Cook 2016-06-07 62 static inline void check_object_size(const void *ptr, unsigned long n, f5509cc18daa7f8 Kees Cook 2016-06-07 63 bool to_user) f5509cc18daa7f8 Kees Cook 2016-06-07 64 { } f5509cc18daa7f8 Kees Cook 2016-06-07 65 #endif /* CONFIG_HARDENED_USERCOPY */ f5509cc18daa7f8 Kees Cook 2016-06-07 66
:::::: The code at line 59 was first introduced by commit :::::: f5509cc18daa7f82bcc553be70df2117c8eedc16 mm: Hardened usercopy
:::::: TO: Kees Cook keescook@chromium.org :::::: CC: Kees Cook keescook@chromium.org