Patch "x86/build: Fix linker fill bytes quirk/incompatibility for ld.lld" has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    x86/build: Fix linker fill bytes quirk/incompatibility for ld.lld

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     x86-build-fix-linker-fill-bytes-quirk-incompatibility-for-ld.lld.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 65e710899fd19f435f40268f3a92dfaa11f14470 Mon Sep 17 00:00:00 2001
From: Song Liu <song@xxxxxxxxxx>
Date: Wed, 6 Sep 2023 10:52:15 -0700
Subject: x86/build: Fix linker fill bytes quirk/incompatibility for ld.lld

From: Song Liu <song@xxxxxxxxxx>

commit 65e710899fd19f435f40268f3a92dfaa11f14470 upstream.

With ":text =0xcccc", ld.lld fills unused text area with 0xcccc0000.
Example objdump -D output:

	ffffffff82b04203:       00 00                   add    %al,(%rax)
	ffffffff82b04205:       cc                      int3
	ffffffff82b04206:       cc                      int3
	ffffffff82b04207:       00 00                   add    %al,(%rax)
	ffffffff82b04209:       cc                      int3
	ffffffff82b0420a:       cc                      int3

Replace it with ":text =0xcccccccc", so we get the following instead:

	ffffffff82b04203:       cc                      int3
	ffffffff82b04204:       cc                      int3
	ffffffff82b04205:       cc                      int3
	ffffffff82b04206:       cc                      int3
	ffffffff82b04207:       cc                      int3
	ffffffff82b04208:       cc                      int3

gcc/ld doesn't seem to have the same issue. The generated code stays the
same for gcc/ld.

Signed-off-by: Song Liu <song@xxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>
Acked-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Fixes: 7705dc855797 ("x86/vmlinux: Use INT3 instead of NOP for linker fill bytes")
Link: https://lore.kernel.org/r/20230906175215.2236033-1-song@xxxxxxxxxx
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 arch/x86/kernel/vmlinux.lds.S |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -156,7 +156,7 @@ SECTIONS
 		ALIGN_ENTRY_TEXT_END
 		*(.gnu.warning)
 
-	} :text =0xcccc
+	} :text = 0xcccccccc
 
 	/* End of text section, which should occupy whole number of pages */
 	_etext = .;


Patches currently in stable-queue which might be from song@xxxxxxxxxx are

queue-6.4/x86-build-fix-linker-fill-bytes-quirk-incompatibility-for-ld.lld.patch
queue-6.4/md-raid5-cache-fix-null-ptr-deref-for-r5l_flush_stri.patch
queue-6.4/md-restore-noio_flag-for-the-last-mddev_resume.patch
queue-6.4/md-raid10-use-dereference_rdev_and_rrdev-to-get-devi.patch
queue-6.4/md-raid1-hold-the-barrier-until-handle_read_error-fi.patch
queue-6.4/md-md-bitmap-hold-reconfig_mutex-in-backlog_store.patch
queue-6.4/md-raid0-fix-performance-regression-for-large-sequen.patch
queue-6.4/md-raid5-cache-fix-a-deadlock-in-r5l_exit_log.patch
queue-6.4/md-md-bitmap-remove-unnecessary-local-variable-in-ba.patch
queue-6.4/md-raid0-account-for-split-bio-in-iostat-accounting.patch
queue-6.4/md-raid0-factor-out-helper-for-mapping-and-submittin.patch
queue-6.4/md-raid10-factor-out-dereference_rdev_and_rrdev.patch
queue-6.4/md-raid1-free-the-r1bio-before-waiting-for-blocked-r.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux