All of lore.kernel.org
 help / color / mirror / Atom feed
* [kees:for-next/hardening 6/14] mm/kasan/kasan_test_c.c:1504:7: warning: argument to variable-length array may be too large due to conversion from 'int' to 'long unsigned int'
@ 2025-05-07  5:49 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2025-05-07  5:49 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "only suspicious fbc files changed"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Kees Cook <kees@kernel.org>
CC: Nathan Chancellor <nathan@kernel.org>
CC: Christoph Hellwig <hch@lst.de>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
head:   48b79238694db6e7eb3dd6153cf71107db624a11
commit: 1ca6c23046d30abfe57d8706248ad5888aafa3bf [6/14] kbuild: Switch from -Wvla to -Wvla-larger-than=1
:::::: branch date: 33 hours ago
:::::: commit date: 9 days ago
config: arm64-randconfig-002-20250502 (https://download.01.org/0day-ci/archive/20250507/202505071331.4iOzqmuE-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250507/202505071331.4iOzqmuE-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/r/202505071331.4iOzqmuE-lkp@intel.com/

All warnings (new ones prefixed by >>):

   mm/kasan/kasan_test_c.c: In function 'kasan_alloca_oob_right':
>> mm/kasan/kasan_test_c.c:1504:7: warning: argument to variable-length array may be too large due to conversion from 'int' to 'long unsigned int' [-Wvla-larger-than=]
     char alloca_array[i];
          ^~~~~~~~~~~~
   mm/kasan/kasan_test_c.c: In function 'kasan_alloca_oob_left':
   mm/kasan/kasan_test_c.c:1489:7: warning: argument to variable-length array may be too large due to conversion from 'int' to 'long unsigned int' [-Wvla-larger-than=]
     char alloca_array[i];
          ^~~~~~~~~~~~
   mm/kasan/kasan_test_c.c: At top level:
   cc1: warning: unrecognized command line option '-Wno-vla-larger-than'


vim +1504 mm/kasan/kasan_test_c.c

00a14294bb33af lib/test_kasan.c Paul Lawrence       2018-02-06  1500  
73228c7ecc5e40 lib/test_kasan.c Patricia Alfonso    2020-10-13  1501  static void kasan_alloca_oob_right(struct kunit *test)
00a14294bb33af lib/test_kasan.c Paul Lawrence       2018-02-06  1502  {
00a14294bb33af lib/test_kasan.c Paul Lawrence       2018-02-06  1503  	volatile int i = 10;
00a14294bb33af lib/test_kasan.c Paul Lawrence       2018-02-06 @1504  	char alloca_array[i];
2dfd1bd992322f lib/test_kasan.c Peter Collingbourne 2022-03-24  1505  	/* See comment in kasan_global_oob_right. */
f649dc0e0d7b50 lib/test_kasan.c Peter Collingbourne 2021-05-14  1506  	char *volatile array = alloca_array;
f649dc0e0d7b50 lib/test_kasan.c Peter Collingbourne 2021-05-14  1507  	char *p = array + i;
00a14294bb33af lib/test_kasan.c Paul Lawrence       2018-02-06  1508  
58b999d7a22c59 lib/test_kasan.c Andrey Konovalov    2020-11-01  1509  	/* Only generic mode instruments dynamic allocas. */
da17e377723f50 lib/test_kasan.c Andrey Konovalov    2021-02-24  1510  	KASAN_TEST_NEEDS_CONFIG_ON(test, CONFIG_KASAN_GENERIC);
da17e377723f50 lib/test_kasan.c Andrey Konovalov    2021-02-24  1511  	KASAN_TEST_NEEDS_CONFIG_ON(test, CONFIG_KASAN_STACK);
00a14294bb33af lib/test_kasan.c Paul Lawrence       2018-02-06  1512  
73228c7ecc5e40 lib/test_kasan.c Patricia Alfonso    2020-10-13  1513  	KUNIT_EXPECT_KASAN_FAIL(test, *(volatile char *)p);
73228c7ecc5e40 lib/test_kasan.c Patricia Alfonso    2020-10-13  1514  }
73228c7ecc5e40 lib/test_kasan.c Patricia Alfonso    2020-10-13  1515  

:::::: The code at line 1504 was first introduced by commit
:::::: 00a14294bb33af533f7ac002fb20623fdd8ea0d7 kasan: add tests for alloca poisoning

:::::: TO: Paul Lawrence <paullawrence@google.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [kees:for-next/hardening 6/14] mm/kasan/kasan_test_c.c:1504:7: warning: argument to variable-length array may be too large due to conversion from 'int' to 'long unsigned int'
@ 2025-05-07  6:08 kernel test robot
  2025-05-07 15:48 ` Kees Cook
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2025-05-07  6:08 UTC (permalink / raw)
  To: Kees Cook; +Cc: oe-kbuild-all, Nathan Chancellor, Christoph Hellwig

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
head:   48b79238694db6e7eb3dd6153cf71107db624a11
commit: 1ca6c23046d30abfe57d8706248ad5888aafa3bf [6/14] kbuild: Switch from -Wvla to -Wvla-larger-than=1
:::::: branch date: 33 hours ago
:::::: commit date: 9 days ago
config: arm64-randconfig-002-20250502 (https://download.01.org/0day-ci/archive/20250507/202505071331.4iOzqmuE-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250507/202505071331.4iOzqmuE-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/r/202505071331.4iOzqmuE-lkp@intel.com/

All warnings (new ones prefixed by >>):

   mm/kasan/kasan_test_c.c: In function 'kasan_alloca_oob_right':
>> mm/kasan/kasan_test_c.c:1504:7: warning: argument to variable-length array may be too large due to conversion from 'int' to 'long unsigned int' [-Wvla-larger-than=]
     char alloca_array[i];
          ^~~~~~~~~~~~
   mm/kasan/kasan_test_c.c: In function 'kasan_alloca_oob_left':
   mm/kasan/kasan_test_c.c:1489:7: warning: argument to variable-length array may be too large due to conversion from 'int' to 'long unsigned int' [-Wvla-larger-than=]
     char alloca_array[i];
          ^~~~~~~~~~~~
   mm/kasan/kasan_test_c.c: At top level:
   cc1: warning: unrecognized command line option '-Wno-vla-larger-than'


vim +1504 mm/kasan/kasan_test_c.c

00a14294bb33af lib/test_kasan.c Paul Lawrence       2018-02-06  1500  
73228c7ecc5e40 lib/test_kasan.c Patricia Alfonso    2020-10-13  1501  static void kasan_alloca_oob_right(struct kunit *test)
00a14294bb33af lib/test_kasan.c Paul Lawrence       2018-02-06  1502  {
00a14294bb33af lib/test_kasan.c Paul Lawrence       2018-02-06  1503  	volatile int i = 10;
00a14294bb33af lib/test_kasan.c Paul Lawrence       2018-02-06 @1504  	char alloca_array[i];
2dfd1bd992322f lib/test_kasan.c Peter Collingbourne 2022-03-24  1505  	/* See comment in kasan_global_oob_right. */
f649dc0e0d7b50 lib/test_kasan.c Peter Collingbourne 2021-05-14  1506  	char *volatile array = alloca_array;
f649dc0e0d7b50 lib/test_kasan.c Peter Collingbourne 2021-05-14  1507  	char *p = array + i;
00a14294bb33af lib/test_kasan.c Paul Lawrence       2018-02-06  1508  
58b999d7a22c59 lib/test_kasan.c Andrey Konovalov    2020-11-01  1509  	/* Only generic mode instruments dynamic allocas. */
da17e377723f50 lib/test_kasan.c Andrey Konovalov    2021-02-24  1510  	KASAN_TEST_NEEDS_CONFIG_ON(test, CONFIG_KASAN_GENERIC);
da17e377723f50 lib/test_kasan.c Andrey Konovalov    2021-02-24  1511  	KASAN_TEST_NEEDS_CONFIG_ON(test, CONFIG_KASAN_STACK);
00a14294bb33af lib/test_kasan.c Paul Lawrence       2018-02-06  1512  
73228c7ecc5e40 lib/test_kasan.c Patricia Alfonso    2020-10-13  1513  	KUNIT_EXPECT_KASAN_FAIL(test, *(volatile char *)p);
73228c7ecc5e40 lib/test_kasan.c Patricia Alfonso    2020-10-13  1514  }
73228c7ecc5e40 lib/test_kasan.c Patricia Alfonso    2020-10-13  1515  

:::::: The code at line 1504 was first introduced by commit
:::::: 00a14294bb33af533f7ac002fb20623fdd8ea0d7 kasan: add tests for alloca poisoning

:::::: TO: Paul Lawrence <paullawrence@google.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [kees:for-next/hardening 6/14] mm/kasan/kasan_test_c.c:1504:7: warning: argument to variable-length array may be too large due to conversion from 'int' to 'long unsigned int'
  2025-05-07  6:08 [kees:for-next/hardening 6/14] mm/kasan/kasan_test_c.c:1504:7: warning: argument to variable-length array may be too large due to conversion from 'int' to 'long unsigned int' kernel test robot
@ 2025-05-07 15:48 ` Kees Cook
  0 siblings, 0 replies; 3+ messages in thread
From: Kees Cook @ 2025-05-07 15:48 UTC (permalink / raw)
  To: kernel test robot
  Cc: oe-kbuild-all, Nathan Chancellor, Christoph Hellwig,
	Arnd Bergmann, linux-hardening

On Wed, May 07, 2025 at 02:08:26PM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
> head:   48b79238694db6e7eb3dd6153cf71107db624a11
> commit: 1ca6c23046d30abfe57d8706248ad5888aafa3bf [6/14] kbuild: Switch from -Wvla to -Wvla-larger-than=1
> :::::: branch date: 33 hours ago
> :::::: commit date: 9 days ago
> config: arm64-randconfig-002-20250502 (https://download.01.org/0day-ci/archive/20250507/202505071331.4iOzqmuE-lkp@intel.com/config)
> compiler: aarch64-linux-gcc (GCC) 8.5.0
> [...]
>    mm/kasan/kasan_test_c.c: At top level:
>    cc1: warning: unrecognized command line option '-Wno-vla-larger-than'

Man, GCC 8 and this option is pretty broken. I've update the patch
again to just do option removal instead of traditional warning
disabling:

https://web.git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?h=for-next/hardening&id=a81be1e542c0f35e171bc564d8b60785a12cff29

Thanks!

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-07 15:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-07  6:08 [kees:for-next/hardening 6/14] mm/kasan/kasan_test_c.c:1504:7: warning: argument to variable-length array may be too large due to conversion from 'int' to 'long unsigned int' kernel test robot
2025-05-07 15:48 ` Kees Cook
  -- strict thread matches above, loose matches on Subject: below --
2025-05-07  5:49 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.