[PATCH v3 14/29] vmlinux.lds.h: Allow EXCEPTION_TABLE to live in RO_DATA
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Borislav Petkov <bp@xxxxxxxxx>
- Subject: [PATCH v3 14/29] vmlinux.lds.h: Allow EXCEPTION_TABLE to live in RO_DATA
- From: Kees Cook <keescook@xxxxxxxxxxxx>
- Date: Tue, 29 Oct 2019 14:13:36 -0700
- Cc: Kees Cook <keescook@xxxxxxxxxxxx>, Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>, Segher Boessenkool <segher@xxxxxxxxxxxxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, Andy Lutomirski <luto@xxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Heiko Carstens <heiko.carstens@xxxxxxxxxx>, Will Deacon <will@xxxxxxxxxx>, linux-arch@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-c6x-dev@xxxxxxxxxxxxx, Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>, Michal Simek <monstr@xxxxxxxxx>
- In-reply-to: <20191029211351.13243-1-keescook@chromium.org>
- References: <20191029211351.13243-1-keescook@chromium.org>
Many architectures have an EXCEPTION_TABLE that only needs to
be readable. As such, it should live in RO_DATA. Create a macro to
identify this case for the architectures that can move EXCEPTION_TABLE
into RO_DATA.
Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>
Acked-by: Will Deacon <will@xxxxxxxxxx>
---
include/asm-generic/vmlinux.lds.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 356078e50a5c..9867d8e41eed 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -69,6 +69,17 @@
#define NOTES_HEADERS_RESTORE
#endif
+/*
+ * Some architectures have non-executable read-only exception tables.
+ * They can be added to the RO_DATA segment by specifying their desired
+ * alignment.
+ */
+#ifdef RO_EXCEPTION_TABLE_ALIGN
+#define RO_EXCEPTION_TABLE EXCEPTION_TABLE(RO_EXCEPTION_TABLE_ALIGN)
+#else
+#define RO_EXCEPTION_TABLE
+#endif
+
/* Align . to a 8 byte boundary equals to maximum function alignment. */
#define ALIGN_FUNCTION() . = ALIGN(8)
@@ -513,6 +524,7 @@
__stop___modver = .; \
} \
\
+ RO_EXCEPTION_TABLE \
NOTES \
\
. = ALIGN((align)); \
--
2.17.1
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]