From 9635226cdd67adda2f9325eb13698d577fc8581c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 17 Sep 2025 17:12:47 +0200 Subject: [PATCH] 6.6-stable patches added patches: x86-disable-image-size-check-for-test-builds.patch --- queue-6.6/series | 1 + ...ble-image-size-check-for-test-builds.patch | 66 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 queue-6.6/x86-disable-image-size-check-for-test-builds.patch diff --git a/queue-6.6/series b/queue-6.6/series index c539ebc52f..ed8d5ac39c 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -99,3 +99,4 @@ ksmbd-fix-null-pointer-dereference-in-alloc_preauth_hash.patch net-mdiobus-release-reset_gpio-in-mdiobus_unregister_device.patch drm-amdgpu-fix-a-memory-leak-in-fence-cleanup-when-unloading.patch drm-i915-power-fix-size-for-for_each_set_bit-in-abox-iteration.patch +x86-disable-image-size-check-for-test-builds.patch diff --git a/queue-6.6/x86-disable-image-size-check-for-test-builds.patch b/queue-6.6/x86-disable-image-size-check-for-test-builds.patch new file mode 100644 index 0000000000..6cb5a68fcc --- /dev/null +++ b/queue-6.6/x86-disable-image-size-check-for-test-builds.patch @@ -0,0 +1,66 @@ +From 00a241f528427b63c415a410293b86e66098888e Mon Sep 17 00:00:00 2001 +From: Guenter Roeck +Date: Wed, 16 Apr 2025 18:09:50 -0700 +Subject: x86: disable image size check for test builds + +From: Guenter Roeck + +commit 00a241f528427b63c415a410293b86e66098888e upstream. + +64-bit allyesconfig builds fail with + +x86_64-linux-ld: kernel image bigger than KERNEL_IMAGE_SIZE + +Bisect points to commit 6f110a5e4f99 ("Disable SLUB_TINY for build +testing") as the responsible commit. Reverting that patch does indeed fix +the problem. Further analysis shows that disabling SLUB_TINY enables +KASAN, and that KASAN is responsible for the image size increase. + +Solve the build problem by disabling the image size check for test +builds. + +[akpm@linux-foundation.org: add comment, fix nearby typo (sink->sync)] +[akpm@linux-foundation.org: fix comment snafu + Link: https://lore.kernel.org/oe-kbuild-all/202504191813.4r9H6Glt-lkp@intel.com/ +Link: https://lkml.kernel.org/r/20250417010950.2203847-1-linux@roeck-us.net +Fixes: 6f110a5e4f99 ("Disable SLUB_TINY for build testing") +Signed-off-by: Guenter Roeck +Cc: Linus Torvalds +Cc: Alexander Potapenko +Cc: Andrey Konovalov +Cc: Andrey Ryabinin +Cc: Borislav Betkov +Cc: Dmitriy Vyukov +Cc: "H. Peter Anvin" +Cc: Ingo Molnar +Cc: Thomas Gleinxer +Cc: Vincenzo Frascino +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kernel/vmlinux.lds.S | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +--- a/arch/x86/kernel/vmlinux.lds.S ++++ b/arch/x86/kernel/vmlinux.lds.S +@@ -500,10 +500,18 @@ SECTIONS + PROVIDE(__ref_stack_chk_guard = __stack_chk_guard); + + /* +- * The ASSERT() sink to . is intentional, for binutils 2.14 compatibility: ++ * COMPILE_TEST kernels can be large - CONFIG_KASAN, for example, can cause ++ * this. Let's assume that nobody will be running a COMPILE_TEST kernel and ++ * let's assert that fuller build coverage is more valuable than being able to ++ * run a COMPILE_TEST kernel. ++ */ ++#ifndef CONFIG_COMPILE_TEST ++/* ++ * The ASSERT() sync to . is intentional, for binutils 2.14 compatibility: + */ + . = ASSERT((_end - LOAD_OFFSET <= KERNEL_IMAGE_SIZE), + "kernel image bigger than KERNEL_IMAGE_SIZE"); ++#endif + + #ifdef CONFIG_X86_64 + /* -- 2.47.3