lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 01 Oct 2019 10:37:00 -0000
From:   "tip-bot2 for Nick Desaulniers" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Borislav Petkov <bp@...en8.de>, Peter Smith <Peter.Smith@....com>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Borislav Petkov <bp@...e.de>, "H. Peter Anvin" <hpa@...or.com>,
        clang-built-linux@...glegroups.com, grimar@...esssoftek.com,
        Ingo Molnar <mingo@...hat.com>, maskray@...gle.com,
        ruiu@...gle.com, Thomas Gleixner <tglx@...utronix.de>,
        "x86-ml" <x86@...nel.org>, Ingo Molnar <mingo@...nel.org>,
        linux-kernel@...r.kernel.org
Subject: [tip: x86/boot] x86/realmode: Explicitly set entry point via ENTRY in
 linker script

The following commit has been merged into the x86/boot branch of tip:

Commit-ID:     3f5f909bc331a7ff9120b11c8e0e320d60b01c89
Gitweb:        https://git.kernel.org/tip/3f5f909bc331a7ff9120b11c8e0e320d60b01c89
Author:        Nick Desaulniers <ndesaulniers@...gle.com>
AuthorDate:    Wed, 25 Sep 2019 11:09:06 -07:00
Committer:     Borislav Petkov <bp@...e.de>
CommitterDate: Tue, 01 Oct 2019 12:17:58 +02:00

x86/realmode: Explicitly set entry point via ENTRY in linker script

Linking with ld.lld via

$ make LD=ld.lld

produces the warning:

  ld.lld: warning: cannot find entry symbol _start; defaulting to 0x1000

Linking with ld.bfd shows the default entry is 0x1000:

$ readelf -h arch/x86/realmode/rm/realmode.elf | grep Entry
  Entry point address:               0x1000

While ld.lld is being pedantic, just set the entry point explicitly,
instead of depending on the implicit default. The symbol pa_text_start
refers to the start of the .text section, which may not be at 0x1000 if
the preceding sections listed in arch/x86/realmode/rm/realmode.lds.S
were large enough. This matches behavior in arch/x86/boot/setup.ld.

Suggested-by: Borislav Petkov <bp@...en8.de>
Suggested-by: Peter Smith <Peter.Smith@....com>
Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
Signed-off-by: Borislav Petkov <bp@...e.de>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: clang-built-linux@...glegroups.com
Cc: grimar@...esssoftek.com
Cc: Ingo Molnar <mingo@...hat.com>
Cc: maskray@...gle.com
Cc: ruiu@...gle.com
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: x86-ml <x86@...nel.org>
Link: https://lkml.kernel.org/r/20190925180908.54260-1-ndesaulniers@google.com
Link: https://github.com/ClangBuiltLinux/linux/issues/216
---
 arch/x86/realmode/rm/realmode.lds.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/realmode/rm/realmode.lds.S b/arch/x86/realmode/rm/realmode.lds.S
index 3bb9808..64d135d 100644
--- a/arch/x86/realmode/rm/realmode.lds.S
+++ b/arch/x86/realmode/rm/realmode.lds.S
@@ -11,6 +11,7 @@
 
 OUTPUT_FORMAT("elf32-i386")
 OUTPUT_ARCH(i386)
+ENTRY(pa_text_start)
 
 SECTIONS
 {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ