All of lore.kernel.org
 help / color / mirror / Atom feed
* [android-common:android-mainline-desktop 0/2] lib/tests/fortify_kunit.c:277:1: warning: stack frame size (8632) exceeds limit (8192) in 'fortify_test_alloc_size_kmalloc_const'
@ 2025-04-12  7:07 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-04-12  7:07 UTC (permalink / raw)
  To: cros-kernel-buildreports; +Cc: oe-kbuild-all

tree:   https://android.googlesource.com/kernel/common android-mainline-desktop
head:   9cb0db5e6c5e307476f66da623a3e905553794fe
commit: 72603f76c56b31ce9258b5be441d9cd894832961 [0/2] Merge fc13a78e1f68 ("Merge tag 'hardening-v6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux") into android-mainline
config: x86_64-randconfig-104-20250412 (https://download.01.org/0day-ci/archive/20250412/202504121425.xGJQkRC9-lkp@intel.com/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250412/202504121425.xGJQkRC9-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/202504121425.xGJQkRC9-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> lib/tests/fortify_kunit.c:277:1: warning: stack frame size (8632) exceeds limit (8192) in 'fortify_test_alloc_size_kmalloc_const' [-Wframe-larger-than]
     277 | DEFINE_ALLOC_SIZE_TEST_PAIR(kmalloc)
         | ^
   lib/tests/fortify_kunit.c:210:13: note: expanded from macro 'DEFINE_ALLOC_SIZE_TEST_PAIR'
     210 | static void fortify_test_alloc_size_##allocator##_const(struct kunit *test) \
         |             ^
   <scratch space>:63:1: note: expanded from here
      63 | fortify_test_alloc_size_kmalloc_const
         | ^
   1 warning generated.


vim +/fortify_test_alloc_size_kmalloc_const +277 lib/tests/fortify_kunit.c

9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  218  
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  219  #define TEST_kmalloc(checker, expected_size, alloc_size)	do {	\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  220  	gfp_t gfp = GFP_KERNEL | __GFP_NOWARN;				\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  221  	void *orig;							\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  222  	size_t len;							\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  223  									\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  224  	checker(expected_size, kmalloc(alloc_size, gfp),		\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  225  		kfree(p));						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  226  	checker(expected_size,						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  227  		kmalloc_node(alloc_size, gfp, NUMA_NO_NODE),		\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  228  		kfree(p));						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  229  	checker(expected_size, kzalloc(alloc_size, gfp),		\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  230  		kfree(p));						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  231  	checker(expected_size,						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  232  		kzalloc_node(alloc_size, gfp, NUMA_NO_NODE),		\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  233  		kfree(p));						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  234  	checker(expected_size, kcalloc(1, alloc_size, gfp),		\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  235  		kfree(p));						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  236  	checker(expected_size, kcalloc(alloc_size, 1, gfp),		\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  237  		kfree(p));						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  238  	checker(expected_size,						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  239  		kcalloc_node(1, alloc_size, gfp, NUMA_NO_NODE),		\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  240  		kfree(p));						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  241  	checker(expected_size,						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  242  		kcalloc_node(alloc_size, 1, gfp, NUMA_NO_NODE),		\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  243  		kfree(p));						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  244  	checker(expected_size, kmalloc_array(1, alloc_size, gfp),	\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  245  		kfree(p));						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  246  	checker(expected_size, kmalloc_array(alloc_size, 1, gfp),	\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  247  		kfree(p));						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  248  	checker(expected_size,						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  249  		kmalloc_array_node(1, alloc_size, gfp, NUMA_NO_NODE),	\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  250  		kfree(p));						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  251  	checker(expected_size,						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  252  		kmalloc_array_node(alloc_size, 1, gfp, NUMA_NO_NODE),	\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  253  		kfree(p));						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  254  									\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  255  	orig = kmalloc(alloc_size, gfp);				\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  256  	KUNIT_EXPECT_TRUE(test, orig != NULL);				\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  257  	checker((expected_size) * 2,					\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  258  		krealloc(orig, (alloc_size) * 2, gfp),			\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  259  		kfree(p));						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  260  	orig = kmalloc(alloc_size, gfp);				\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  261  	KUNIT_EXPECT_TRUE(test, orig != NULL);				\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  262  	checker((expected_size) * 2,					\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  263  		krealloc_array(orig, 1, (alloc_size) * 2, gfp),		\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  264  		kfree(p));						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  265  	orig = kmalloc(alloc_size, gfp);				\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  266  	KUNIT_EXPECT_TRUE(test, orig != NULL);				\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  267  	checker((expected_size) * 2,					\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  268  		krealloc_array(orig, (alloc_size) * 2, 1, gfp),		\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  269  		kfree(p));						\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  270  									\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  271  	len = 11;							\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  272  	/* Using memdup() with fixed size, so force unknown length. */	\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  273  	if (!__builtin_constant_p(expected_size))			\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  274  		len += zero_size;					\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  275  	checker(len, kmemdup("hello there", len, gfp), kfree(p));	\
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  276  } while (0)
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29 @277  DEFINE_ALLOC_SIZE_TEST_PAIR(kmalloc)
9124a26401483b lib/fortify_kunit.c Kees Cook 2022-09-29  278  

:::::: The code at line 277 was first introduced by commit
:::::: 9124a26401483bf2b13a99cb4317dce3f677060f kunit/fortify: Validate __alloc_size attribute results

:::::: TO: Kees Cook <keescook@chromium.org>
:::::: CC: Kees Cook <keescook@chromium.org>

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-04-12  7:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-12  7:07 [android-common:android-mainline-desktop 0/2] lib/tests/fortify_kunit.c:277:1: warning: stack frame size (8632) exceeds limit (8192) in 'fortify_test_alloc_size_kmalloc_const' 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.