提交 3ac946d1 编写于 作者: K Kees Cook 提交者: James Morris

vmlinux.lds.h: Move LSM_TABLE into INIT_DATA

Since the struct lsm_info table is not an initcall, we can just move it
into INIT_DATA like all the other tables.
Signed-off-by: NKees Cook <keescook@chromium.org>
Reviewed-by: NCasey Schaufler <casey@schaufler-ca.com>
Reviewed-by: NJohn Johansen <john.johansen@canonical.com>
Reviewed-by: NJames Morris <james.morris@microsoft.com>
Signed-off-by: NJames Morris <james.morris@microsoft.com>
上级 5b89c1bd
...@@ -71,7 +71,6 @@ SECTIONS ...@@ -71,7 +71,6 @@ SECTIONS
INIT_SETUP(L1_CACHE_BYTES) INIT_SETUP(L1_CACHE_BYTES)
INIT_CALLS INIT_CALLS
CON_INITCALL CON_INITCALL
SECURITY_INITCALL
} }
.init.arch.info : { .init.arch.info : {
......
...@@ -96,7 +96,6 @@ SECTIONS ...@@ -96,7 +96,6 @@ SECTIONS
INIT_SETUP(16) INIT_SETUP(16)
INIT_CALLS INIT_CALLS
CON_INITCALL CON_INITCALL
SECURITY_INITCALL
INIT_RAM_FS INIT_RAM_FS
} }
......
...@@ -166,7 +166,6 @@ SECTIONS ...@@ -166,7 +166,6 @@ SECTIONS
INIT_SETUP(16) INIT_SETUP(16)
INIT_CALLS INIT_CALLS
CON_INITCALL CON_INITCALL
SECURITY_INITCALL
INIT_RAM_FS INIT_RAM_FS
*(.init.rodata.* .init.bss) /* from the EFI stub */ *(.init.rodata.* .init.bss) /* from the EFI stub */
} }
......
...@@ -56,7 +56,6 @@ SECTIONS ...@@ -56,7 +56,6 @@ SECTIONS
__init_begin = .; __init_begin = .;
INIT_TEXT_SECTION(4) INIT_TEXT_SECTION(4)
INIT_DATA_SECTION(4) INIT_DATA_SECTION(4)
SECURITY_INIT
__init_end = .; __init_end = .;
_edata = . ; _edata = . ;
_begin_data = LOADADDR(.data); _begin_data = LOADADDR(.data);
......
...@@ -117,8 +117,6 @@ SECTIONS { ...@@ -117,8 +117,6 @@ SECTIONS {
CON_INITCALL CON_INITCALL
} }
SECURITY_INIT
__init_end_before_initramfs = .; __init_end_before_initramfs = .;
.init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
......
...@@ -212,8 +212,6 @@ SECTIONS ...@@ -212,8 +212,6 @@ SECTIONS
CON_INITCALL CON_INITCALL
} }
SECURITY_INIT
. = ALIGN(8); . = ALIGN(8);
__ftr_fixup : AT(ADDR(__ftr_fixup) - LOAD_OFFSET) { __ftr_fixup : AT(ADDR(__ftr_fixup) - LOAD_OFFSET) {
__start___ftr_fixup = .; __start___ftr_fixup = .;
......
...@@ -53,8 +53,6 @@ ...@@ -53,8 +53,6 @@
CON_INITCALL CON_INITCALL
} }
SECURITY_INIT
.exitcall : { .exitcall : {
__exitcall_begin = .; __exitcall_begin = .;
*(.exitcall.exit) *(.exitcall.exit)
......
...@@ -197,7 +197,6 @@ SECTIONS ...@@ -197,7 +197,6 @@ SECTIONS
INIT_SETUP(XCHAL_ICACHE_LINESIZE) INIT_SETUP(XCHAL_ICACHE_LINESIZE)
INIT_CALLS INIT_CALLS
CON_INITCALL CON_INITCALL
SECURITY_INITCALL
INIT_RAM_FS INIT_RAM_FS
} }
......
...@@ -203,6 +203,15 @@ ...@@ -203,6 +203,15 @@
#define EARLYCON_TABLE() #define EARLYCON_TABLE()
#endif #endif
#ifdef CONFIG_SECURITY
#define LSM_TABLE() . = ALIGN(8); \
__start_lsm_info = .; \
KEEP(*(.lsm_info.init)) \
__end_lsm_info = .;
#else
#define LSM_TABLE()
#endif
#define ___OF_TABLE(cfg, name) _OF_TABLE_##cfg(name) #define ___OF_TABLE(cfg, name) _OF_TABLE_##cfg(name)
#define __OF_TABLE(cfg, name) ___OF_TABLE(cfg, name) #define __OF_TABLE(cfg, name) ___OF_TABLE(cfg, name)
#define OF_TABLE(cfg, name) __OF_TABLE(IS_ENABLED(cfg), name) #define OF_TABLE(cfg, name) __OF_TABLE(IS_ENABLED(cfg), name)
...@@ -597,7 +606,8 @@ ...@@ -597,7 +606,8 @@
IRQCHIP_OF_MATCH_TABLE() \ IRQCHIP_OF_MATCH_TABLE() \
ACPI_PROBE_TABLE(irqchip) \ ACPI_PROBE_TABLE(irqchip) \
ACPI_PROBE_TABLE(timer) \ ACPI_PROBE_TABLE(timer) \
EARLYCON_TABLE() EARLYCON_TABLE() \
LSM_TABLE()
#define INIT_TEXT \ #define INIT_TEXT \
*(.init.text .init.text.*) \ *(.init.text .init.text.*) \
...@@ -786,17 +796,6 @@ ...@@ -786,17 +796,6 @@
KEEP(*(.con_initcall.init)) \ KEEP(*(.con_initcall.init)) \
__con_initcall_end = .; __con_initcall_end = .;
#define SECURITY_INITCALL \
__start_lsm_info = .; \
KEEP(*(.lsm_info.init)) \
__end_lsm_info = .;
/* Older linker script style for security init. */
#define SECURITY_INIT \
.lsm_info.init : AT(ADDR(.lsm_info.init) - LOAD_OFFSET) { \
LSM_INFO \
}
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
#define INIT_RAM_FS \ #define INIT_RAM_FS \
. = ALIGN(4); \ . = ALIGN(4); \
...@@ -963,7 +962,6 @@ ...@@ -963,7 +962,6 @@
INIT_SETUP(initsetup_align) \ INIT_SETUP(initsetup_align) \
INIT_CALLS \ INIT_CALLS \
CON_INITCALL \ CON_INITCALL \
SECURITY_INITCALL \
INIT_RAM_FS \ INIT_RAM_FS \
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册