linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Kees Cook <keescook@chromium.org>, Arnd Bergmann <arnd@arndb.de>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-arch@vger.kernel.org, Jessica Yu <jeyu@kernel.org>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Alexander Egorenkov <egorenar@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Ilya Leoshkevich <iii@linux.ibm.com>,
	"Steven Rostedt (VMware)" <rostedt@goodmis.org>,
	Ingo Molnar <mingo@kernel.org>,
	Sami Tolvanen <samitolvanen@google.com>,
	linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
	linux-hardening@vger.kernel.org
Subject: [PATCH 2/4] vmlinux.lds.h: Split .static_call_sites from .static_call_tramp_key
Date: Wed,  1 Sep 2021 16:37:55 -0700	[thread overview]
Message-ID: <20210901233757.2571878-3-keescook@chromium.org> (raw)
In-Reply-To: <20210901233757.2571878-1-keescook@chromium.org>

These two sections are ro_after_init and .rodata respectively. While
they will ultimately become read-only, there's no reason to confuse
their macro names.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 include/asm-generic/vmlinux.lds.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 70c74fdf9c9b..4781a8154254 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -396,17 +396,22 @@
 	. = __start_init_task + THREAD_SIZE;				\
 	__end_init_task = .;
 
+/* Sorted during __init. */
 #define JUMP_TABLE_RO_AFTER_INIT_DATA					\
 	. = ALIGN(8);							\
 	__start___jump_table = .;					\
 	KEEP(*(__jump_table))						\
 	__stop___jump_table = .;
 
+/* Sorted during __init. */
 #define STATIC_CALL_RO_AFTER_INIT_DATA					\
 	. = ALIGN(8);							\
 	__start_static_call_sites = .;					\
 	KEEP(*(.static_call_sites))					\
 	__stop_static_call_sites = .;					\
+
+#define STATIC_CALL_RODATA						\
+	. = ALIGN(8);							\
 	__start_static_call_tramp_key = .;				\
 	KEEP(*(.static_call_tramp_key))					\
 	__stop_static_call_tramp_key = .;
@@ -434,6 +439,7 @@
 		__start_rodata = .;					\
 		*(.rodata) *(.rodata.*)					\
 		SCHED_RODATA						\
+		STATIC_CALL_RODATA					\
 		RO_AFTER_INIT_DATA	/* Read only after init */	\
 		. = ALIGN(8);						\
 		__start___tracepoints_ptrs = .;				\
-- 
2.30.2


  parent reply	other threads:[~2021-09-01 23:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01 23:37 [PATCH 0/4] Fix ro_after_init vs static_call Kees Cook
2021-09-01 23:37 ` [PATCH 1/4] vmlinux.lds.h: Use regular *RODATA and *RO_AFTER_INIT_DATA suffixes Kees Cook
2021-09-03  5:55   ` Josh Poimboeuf
2021-09-03  8:17   ` Heiko Carstens
2021-09-01 23:37 ` Kees Cook [this message]
2021-09-03  5:55   ` [PATCH 2/4] vmlinux.lds.h: Split .static_call_sites from .static_call_tramp_key Josh Poimboeuf
2021-09-01 23:37 ` [PATCH 3/4] module: Use a list of strings for ro_after_init sections Kees Cook
2021-09-03  6:49   ` Josh Poimboeuf
2021-09-03 16:38     ` Kees Cook
2021-09-04  4:09       ` Josh Poimboeuf
2021-09-04 14:40         ` Kees Cook
2021-09-01 23:37 ` [PATCH 4/4] module: Include .static_call_sites in module ro_after_init Kees Cook

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=20210901233757.2571878-3-keescook@chromium.org \
    --to=keescook@chromium.org \
    --cc=arnd@arndb.de \
    --cc=borntraeger@de.ibm.com \
    --cc=egorenar@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=jeyu@kernel.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=samitolvanen@google.com \
    --cc=svens@linux.ibm.com \
    --subject='Re: [PATCH 2/4] vmlinux.lds.h: Split .static_call_sites from .static_call_tramp_key' \
    /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

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).