Skip to content

Commit

Permalink
Revert "selinux: Relocate ss_initialized and selinux_enforcing to sep…
Browse files Browse the repository at this point in the history
…arate 4k"

This reverts commit 50240fa.

That out of tree patch causes the resulting kernel image to be too
large, causing ld.lld to error; since .bss is specified twice.

Fixes the observed error:
ld.lld: error: output file too large: 18446743524330100280 bytes

when using LLD without LTO enabled.

We observe similar errors with binutils 2.36+

Bug: 151154720
Reported-by: Matthias Maennich <[email protected]>
Debugged-by: Fangrui Song <[email protected]>
Signed-off-by: Nick Desaulniers <[email protected]>
Change-Id: Iebb8135630132cd4ae49f3d2d1e85bd61cfa6111
  • Loading branch information
nickdesaulniers authored and schqiushui committed Apr 24, 2021
1 parent 6756121 commit 96abd16
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
8 changes: 0 additions & 8 deletions arch/arm64/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ jiffies = jiffies_64;
#define TRAMP_TEXT
#endif

#define RTIC_BSS \
. = ALIGN(PAGE_SIZE); \
KEEP(*(.bss.rtic)); \
. = ALIGN(PAGE_SIZE); \
/*
* The size of the PE/COFF section that covers the kernel image, which
* runs from stext to _edata, must be a round multiple of the PE/COFF
Expand Down Expand Up @@ -252,10 +248,6 @@ SECTIONS
STABS_DEBUG

HEAD_SYMBOLS

.bss : { /* bss segment */
RTIC_BSS
}
}

/*
Expand Down
2 changes: 0 additions & 2 deletions include/linux/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,6 @@ void __init parse_early_options(char *cmdline);
/* Data marked not to be saved by software suspend */
#define __nosavedata __section(.data..nosave)

#define __rticdata __attribute__((section(".bss.rtic")))

#ifdef MODULE
#define __exit_p(x) x
#else
Expand Down
2 changes: 1 addition & 1 deletion security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
#include "audit.h"
#include "avc_ss.h"

struct selinux_state selinux_state __rticdata;
struct selinux_state selinux_state;

/* SECMARK reference count */
static atomic_t selinux_secmark_refcount = ATOMIC_INIT(0);
Expand Down

0 comments on commit 96abd16

Please sign in to comment.