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>] [day] [month] [year] [list]
Date:   Fri, 22 May 2020 12:40:28 -0000
From:   "tip-bot2 for Fangrui Song" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     kbuild test robot <lkp@...el.com>,
        Fangrui Song <maskray@...gle.com>,
        Borislav Petkov <bp@...e.de>,
        Kees Cook <keescook@...omium.org>,
        Arvind Sankar <nivedita@...m.mit.edu>,
        Sedat Dilek <sedat.dilek@...il.com>, x86 <x86@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: [tip: x86/build] x86/boot: Discard .discard.unreachable for
 arch/x86/boot/compressed/vmlinux

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

Commit-ID:     d6ee6529436a15a0541aff6e1697989ee7dc2c44
Gitweb:        https://git.kernel.org/tip/d6ee6529436a15a0541aff6e1697989ee7dc2c44
Author:        Fangrui Song <maskray@...gle.com>
AuthorDate:    Wed, 20 May 2020 11:20:10 -07:00
Committer:     Borislav Petkov <bp@...e.de>
CommitterDate: Fri, 22 May 2020 12:42:07 +02:00

x86/boot: Discard .discard.unreachable for arch/x86/boot/compressed/vmlinux

With commit

  ce5e3f909fc0 ("efi/printf: Add 64-bit and 8-bit integer support")

arch/x86/boot/compressed/vmlinux may have an undesired .discard.unreachable
section coming from drivers/firmware/efi/libstub/vsprintf.stub.o. That section
gets generated from unreachable() annotations when CONFIG_STACK_VALIDATION is
enabled.

.discard.unreachable contains an R_X86_64_PC32 relocation which will be
warned about by LLD: a non-SHF_ALLOC section (.discard.unreachable) is
not part of the memory image, thus conceptually the distance between a
non-SHF_ALLOC and a SHF_ALLOC is not a constant which can be resolved at
link time:

  % ld.lld -m elf_x86_64 -T arch/x86/boot/compressed/vmlinux.lds ... -o arch/x86/boot/compressed/vmlinux
  ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''

Reuse the DISCARDS macro which includes .discard.* to drop
.discard.unreachable.

 [ bp: Massage and complete the commit message. ]

Reported-by: kbuild test robot <lkp@...el.com>
Signed-off-by: Fangrui Song <maskray@...gle.com>
Signed-off-by: Borislav Petkov <bp@...e.de>
Reviewed-by: Kees Cook <keescook@...omium.org>
Tested-by: Arvind Sankar <nivedita@...m.mit.edu>
Tested-by: Sedat Dilek <sedat.dilek@...il.com>
Link: https://lkml.kernel.org/r/20200520182010.242489-1-maskray@google.com
---
 arch/x86/boot/compressed/vmlinux.lds.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S
index 508cfa6..1031af1 100644
--- a/arch/x86/boot/compressed/vmlinux.lds.S
+++ b/arch/x86/boot/compressed/vmlinux.lds.S
@@ -73,4 +73,6 @@ SECTIONS
 #endif
 	. = ALIGN(PAGE_SIZE);	/* keep ZO size page aligned */
 	_end = .;
+
+	DISCARDS
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ