Skip to content

Commit bb54088

Browse files
committed
stackinit: Keep selftest union size small on m68k
The stack frame on m68k is very sensitive to the size of what needs to be stored. Like done for long string testing, reduce the size of the large trailing struct in the union initialization testing. Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Closes: https://lore.kernel.org/all/CAMuHMdXW8VbtOAixO7w+aDOG70aZtZ50j1Ybcr8B3eYnRUcrcA@mail.gmail.com Fixes: e71a29d ("stackinit: Add union initialization to selftests") Link: https://lore.kernel.org/r/20250204174509.work.711-kees@kernel.org Signed-off-by: Kees Cook <kees@kernel.org> Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
1 parent dce4aab commit bb54088

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/stackinit_kunit.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ static bool stackinit_range_contains(char *haystack_start, size_t haystack_size,
7575
*/
7676
#ifdef CONFIG_M68K
7777
#define FILL_SIZE_STRING 8
78+
#define FILL_SIZE_ARRAY 2
7879
#else
7980
#define FILL_SIZE_STRING 16
81+
#define FILL_SIZE_ARRAY 8
8082
#endif
8183

8284
#define INIT_CLONE_SCALAR /**/
@@ -345,7 +347,7 @@ union test_small_start {
345347
short three;
346348
unsigned long four;
347349
struct big_struct {
348-
unsigned long array[8];
350+
unsigned long array[FILL_SIZE_ARRAY];
349351
} big;
350352
};
351353

0 commit comments

Comments
 (0)