Skip to content

Commit 3ac946d

Browse files
keesJames Morris
authored andcommitted
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: Kees Cook <keescook@chromium.org> Reviewed-by: Casey Schaufler <casey@schaufler-ca.com> Reviewed-by: John Johansen <john.johansen@canonical.com> Reviewed-by: James Morris <james.morris@microsoft.com> Signed-off-by: James Morris <james.morris@microsoft.com>
1 parent 5b89c1b commit 3ac946d

File tree

9 files changed

+11
-24
lines changed

9 files changed

+11
-24
lines changed

arch/arc/kernel/vmlinux.lds.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ SECTIONS
7171
INIT_SETUP(L1_CACHE_BYTES)
7272
INIT_CALLS
7373
CON_INITCALL
74-
SECURITY_INITCALL
7574
}
7675

7776
.init.arch.info : {

arch/arm/kernel/vmlinux-xip.lds.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ SECTIONS
9696
INIT_SETUP(16)
9797
INIT_CALLS
9898
CON_INITCALL
99-
SECURITY_INITCALL
10099
INIT_RAM_FS
101100
}
102101

arch/arm64/kernel/vmlinux.lds.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ SECTIONS
166166
INIT_SETUP(16)
167167
INIT_CALLS
168168
CON_INITCALL
169-
SECURITY_INITCALL
170169
INIT_RAM_FS
171170
*(.init.rodata.* .init.bss) /* from the EFI stub */
172171
}

arch/h8300/kernel/vmlinux.lds.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ SECTIONS
5656
__init_begin = .;
5757
INIT_TEXT_SECTION(4)
5858
INIT_DATA_SECTION(4)
59-
SECURITY_INIT
6059
__init_end = .;
6160
_edata = . ;
6261
_begin_data = LOADADDR(.data);

arch/microblaze/kernel/vmlinux.lds.S

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ SECTIONS {
117117
CON_INITCALL
118118
}
119119

120-
SECURITY_INIT
121-
122120
__init_end_before_initramfs = .;
123121

124122
.init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {

arch/powerpc/kernel/vmlinux.lds.S

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,6 @@ SECTIONS
212212
CON_INITCALL
213213
}
214214

215-
SECURITY_INIT
216-
217215
. = ALIGN(8);
218216
__ftr_fixup : AT(ADDR(__ftr_fixup) - LOAD_OFFSET) {
219217
__start___ftr_fixup = .;

arch/um/include/asm/common.lds.S

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@
5353
CON_INITCALL
5454
}
5555

56-
SECURITY_INIT
57-
5856
.exitcall : {
5957
__exitcall_begin = .;
6058
*(.exitcall.exit)

arch/xtensa/kernel/vmlinux.lds.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ SECTIONS
197197
INIT_SETUP(XCHAL_ICACHE_LINESIZE)
198198
INIT_CALLS
199199
CON_INITCALL
200-
SECURITY_INITCALL
201200
INIT_RAM_FS
202201
}
203202

include/asm-generic/vmlinux.lds.h

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,15 @@
203203
#define EARLYCON_TABLE()
204204
#endif
205205

206+
#ifdef CONFIG_SECURITY
207+
#define LSM_TABLE() . = ALIGN(8); \
208+
__start_lsm_info = .; \
209+
KEEP(*(.lsm_info.init)) \
210+
__end_lsm_info = .;
211+
#else
212+
#define LSM_TABLE()
213+
#endif
214+
206215
#define ___OF_TABLE(cfg, name) _OF_TABLE_##cfg(name)
207216
#define __OF_TABLE(cfg, name) ___OF_TABLE(cfg, name)
208217
#define OF_TABLE(cfg, name) __OF_TABLE(IS_ENABLED(cfg), name)
@@ -597,7 +606,8 @@
597606
IRQCHIP_OF_MATCH_TABLE() \
598607
ACPI_PROBE_TABLE(irqchip) \
599608
ACPI_PROBE_TABLE(timer) \
600-
EARLYCON_TABLE()
609+
EARLYCON_TABLE() \
610+
LSM_TABLE()
601611

602612
#define INIT_TEXT \
603613
*(.init.text .init.text.*) \
@@ -786,17 +796,6 @@
786796
KEEP(*(.con_initcall.init)) \
787797
__con_initcall_end = .;
788798

789-
#define SECURITY_INITCALL \
790-
__start_lsm_info = .; \
791-
KEEP(*(.lsm_info.init)) \
792-
__end_lsm_info = .;
793-
794-
/* Older linker script style for security init. */
795-
#define SECURITY_INIT \
796-
.lsm_info.init : AT(ADDR(.lsm_info.init) - LOAD_OFFSET) { \
797-
LSM_INFO \
798-
}
799-
800799
#ifdef CONFIG_BLK_DEV_INITRD
801800
#define INIT_RAM_FS \
802801
. = ALIGN(4); \
@@ -963,7 +962,6 @@
963962
INIT_SETUP(initsetup_align) \
964963
INIT_CALLS \
965964
CON_INITCALL \
966-
SECURITY_INITCALL \
967965
INIT_RAM_FS \
968966
}
969967

0 commit comments

Comments
 (0)