All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/5] arm64/kernel: get rid of GCC large model code
@ 2018-03-06 17:15 Ard Biesheuvel
  2018-03-06 17:15 ` [PATCH v4 1/5] arm64: module: don't BUG when exceeding preallocated PLT count Ard Biesheuvel
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Ard Biesheuvel @ 2018-03-06 17:15 UTC (permalink / raw)
  To: linux-arm-kernel

GCC's large model uses literal pools to emit cross object symbol
references rather than movz/movk sequences, resulting in data items
mixed in the with executable code in modules' .text segments, reducing
cache utilization, but also potentially resulting in the creation of
code gadgets that are exploitable under speculative execution.

We are using GCC's large model for two separate reasons, both of which can
be worked around rather easily:
- KASLR uses it to move modules and the kernel very far apart, which is
  not really needed,
- the Cortex-A53 erratum code uses it to avoid ADRP instruction altogether,
  which can be replaced by selective patching of only the ADRP instructions
  that are affected by the erratum

v4:
- dropped RFC prefix
- added patch #1 and #4
- use _AC() for new SIZE_4G constant with ULL prefix (#2)
- improve comments, get rid of BUG() when running out of PLT entries (#3)
- rely on new REVIDR checking code (#5)

Ard Biesheuvel (5):
  arm64: module: don't BUG when exceeding preallocated PLT count
  arm64/kernel: kaslr: reduce module randomization range to 4 GB
  arm64/kernel: don't ban ADRP to work around Cortex-A53 erratum #843419
  arm64/errata: add REVIDR handling to framework
  arm64/kernel: enable A53 erratum #8434319 handling at runtime

 arch/arm64/Kconfig                  | 18 ++--
 arch/arm64/Makefile                 |  5 --
 arch/arm64/include/asm/cpucaps.h    |  3 +-
 arch/arm64/include/asm/cpufeature.h |  4 +
 arch/arm64/include/asm/module.h     |  2 +
 arch/arm64/kernel/cpu_errata.c      | 31 ++++++-
 arch/arm64/kernel/kaslr.c           | 20 +++--
 arch/arm64/kernel/module-plts.c     | 90 +++++++++++++++++++-
 arch/arm64/kernel/module.c          | 42 +++++++--
 arch/arm64/kernel/reloc_test_core.c |  4 +-
 arch/arm64/kernel/reloc_test_syms.S | 12 ++-
 include/linux/sizes.h               |  4 +
 12 files changed, 191 insertions(+), 44 deletions(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-03-08 13:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-06 17:15 [PATCH v4 0/5] arm64/kernel: get rid of GCC large model code Ard Biesheuvel
2018-03-06 17:15 ` [PATCH v4 1/5] arm64: module: don't BUG when exceeding preallocated PLT count Ard Biesheuvel
2018-03-06 17:15 ` [PATCH v4 2/5] arm64/kernel: kaslr: reduce module randomization range to 4 GB Ard Biesheuvel
2018-03-06 17:15 ` [PATCH v4 3/5] arm64/kernel: don't ban ADRP to work around Cortex-A53 erratum #843419 Ard Biesheuvel
2018-03-06 17:15 ` [PATCH v4 4/5] arm64/errata: add REVIDR handling to framework Ard Biesheuvel
2018-03-06 17:15 ` [PATCH v4 5/5] arm64/kernel: enable A53 erratum #8434319 handling at runtime Ard Biesheuvel
2018-03-08 13:45   ` Will Deacon
2018-03-08 13:46     ` Ard Biesheuvel
2018-03-08 13:47       ` Ard Biesheuvel
2018-03-08 13:48         ` Will Deacon
2018-03-08 13:49       ` Mark Rutland
2018-03-08 13:54         ` Ard Biesheuvel
2018-03-08 13:59           ` Will Deacon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.