linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "tip-bot2 for Kristen Carlson Accardi" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Kristen Carlson Accardi <kristen@linux.intel.com>,
	Alexander Lobakin <alexandr.lobakin@intel.com>,
	Kees Cook <keescook@chromium.org>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Tony Luck <tony.luck@intel.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/core] vmlinux.lds.h: Have ORC lookup cover entire _etext - _stext
Date: Thu, 28 Oct 2021 13:29:33 -0000	[thread overview]
Message-ID: <163542777304.626.17338682230666549954.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20211013175742.1197608-5-keescook@chromium.org>

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

Commit-ID:     ca136cac37eb51649d52d5bc4271c55e30ed354c
Gitweb:        https://git.kernel.org/tip/ca136cac37eb51649d52d5bc4271c55e30ed354c
Author:        Kristen Carlson Accardi <kristen@linux.intel.com>
AuthorDate:    Wed, 13 Oct 2021 10:57:42 -07:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 27 Oct 2021 11:07:59 +02:00

vmlinux.lds.h: Have ORC lookup cover entire _etext - _stext

When using -ffunction-sections to place each function in its own text
section (so it can be randomized at load time in the future FGKASLR
series), the linker will place most of the functions into separate .text.*
sections. SIZEOF(.text) won't work here for calculating the ORC lookup
table size, so the total text size must be calculated to include .text
AND all .text.* sections.

Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
[ alobakin: move it to vmlinux.lds.h and make arch-indep ]
Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Tested-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/r/20211013175742.1197608-5-keescook@chromium.org
---
 include/asm-generic/vmlinux.lds.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index f2984af..e823491 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -869,10 +869,11 @@
 		KEEP(*(.orc_unwind))					\
 		__stop_orc_unwind = .;					\
 	}								\
+	text_size = _etext - _stext;					\
 	. = ALIGN(4);							\
 	.orc_lookup : AT(ADDR(.orc_lookup) - LOAD_OFFSET) {		\
 		orc_lookup = .;						\
-		. += (((SIZEOF(.text) + LOOKUP_BLOCK_SIZE - 1) /	\
+		. += (((text_size + LOOKUP_BLOCK_SIZE - 1) /		\
 			LOOKUP_BLOCK_SIZE) + 1) * 4;			\
 		orc_lookup_end = .;					\
 	}

  parent reply	other threads:[~2021-10-28 13:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-13 17:57 [PATCH 0/4] x86: Various clean-ups in support of FGKASLR Kees Cook
2021-10-13 17:57 ` [PATCH 1/4] x86/tools/relocs: Support >64K section headers Kees Cook
2021-10-28 13:29   ` [tip: x86/core] " tip-bot2 for Kristen Carlson Accardi
2021-10-13 17:57 ` [PATCH 2/4] x86/boot: Allow a "silent" kaslr random byte fetch Kees Cook
2021-10-13 18:10   ` Nick Desaulniers
2021-10-28 13:29   ` [tip: x86/core] " tip-bot2 for Kees Cook
2021-10-13 17:57 ` [PATCH 3/4] x86/boot/compressed: Avoid duplicate malloc() implementations Kees Cook
2021-10-28 13:29   ` [tip: x86/core] " tip-bot2 for Kees Cook
2021-10-13 17:57 ` [PATCH 4/4] vmlinux.lds.h: Have ORC lookup cover entire _etext - _stext Kees Cook
2021-10-14  0:29   ` Josh Poimboeuf
2021-10-28 13:29   ` tip-bot2 for Kristen Carlson Accardi [this message]
2021-10-15 18:27 ` [PATCH 0/4] x86: Various clean-ups in support of FGKASLR Alexander Lobakin
2021-10-27  6:10 ` Kees Cook
2021-10-27  6:57 ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=163542777304.626.17338682230666549954.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=alexandr.lobakin@intel.com \
    --cc=jpoimboe@redhat.com \
    --cc=keescook@chromium.org \
    --cc=kristen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).