All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] powerpc/32s: Allocate modules outside of vmalloc space for STRICT_KERNEL_RWX
@ 2020-06-29 11:15 ` Christophe Leroy
  0 siblings, 0 replies; 22+ messages in thread
From: Christophe Leroy @ 2020-06-29 11:15 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
  Cc: linux-kernel, linuxppc-dev

On book3s32 (hash), exec protection is set per 256Mb segments with NX bit.
Instead of clearing NX bit on vmalloc space when CONFIG_MODULES is selected,
allocate modules in a dedicated segment (0xb0000000-0xbfffffff by default).
This allows to keep exec protection on vmalloc space while allowing exec
on modules.

v2:
- Removed the two patches that fix ptdump. Will submitted independently
- Only changing the user/kernel boundary for PPC32 now.
- Reordered the patches inside the series.

Christophe Leroy (6):
  powerpc/lib: Prepare code-patching for modules allocated outside
    vmalloc space
  powerpc: Use MODULES_VADDR if defined
  powerpc/32s: Only leave NX unset on segments used for modules
  powerpc/32: Set user/kernel boundary at TASK_SIZE instead of
    PAGE_OFFSET
  powerpc/32s: Kernel space starts at TASK_SIZE
  powerpc/32s: Use dedicated segment for modules with STRICT_KERNEL_RWX

 arch/powerpc/Kconfig                         |  1 +
 arch/powerpc/include/asm/book3s/32/pgtable.h | 15 +++++----------
 arch/powerpc/include/asm/page.h              |  4 +++-
 arch/powerpc/kernel/head_32.S                | 12 ++++++------
 arch/powerpc/kernel/module.c                 | 11 +++++++++++
 arch/powerpc/lib/code-patching.c             |  2 +-
 arch/powerpc/mm/book3s32/hash_low.S          |  2 +-
 arch/powerpc/mm/book3s32/mmu.c               | 17 ++++++++++++++---
 arch/powerpc/mm/kasan/kasan_init_32.c        |  6 ++++++
 arch/powerpc/mm/ptdump/ptdump.c              | 16 ++++++++++++++--
 10 files changed, 62 insertions(+), 24 deletions(-)

-- 
2.25.0


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

end of thread, other threads:[~2020-08-21  6:45 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29 11:15 [PATCH v2 0/6] powerpc/32s: Allocate modules outside of vmalloc space for STRICT_KERNEL_RWX Christophe Leroy
2020-06-29 11:15 ` Christophe Leroy
2020-06-29 11:15 ` [PATCH v2 1/6] powerpc/lib: Prepare code-patching for modules allocated outside vmalloc space Christophe Leroy
2020-06-29 11:15   ` Christophe Leroy
2020-06-29 11:15 ` [PATCH v2 2/6] powerpc: Use MODULES_VADDR if defined Christophe Leroy
2020-06-29 11:15   ` Christophe Leroy
2020-06-29 11:15 ` [PATCH v2 3/6] powerpc/32s: Only leave NX unset on segments used for modules Christophe Leroy
2020-06-29 11:15   ` Christophe Leroy
2020-08-20 22:00   ` Andreas Schwab
2020-08-20 22:00     ` Andreas Schwab
2020-08-21  5:11     ` Christophe Leroy
2020-08-21  5:11       ` Christophe Leroy
2020-08-21  6:43       ` Christophe Leroy
2020-08-21  6:43         ` Christophe Leroy
2020-06-29 11:15 ` [PATCH v2 4/6] powerpc/32: Set user/kernel boundary at TASK_SIZE instead of PAGE_OFFSET Christophe Leroy
2020-06-29 11:15   ` Christophe Leroy
2020-06-29 11:15 ` [PATCH v2 5/6] powerpc/32s: Kernel space starts at TASK_SIZE Christophe Leroy
2020-06-29 11:15   ` Christophe Leroy
2020-06-29 11:15 ` [PATCH v2 6/6] powerpc/32s: Use dedicated segment for modules with STRICT_KERNEL_RWX Christophe Leroy
2020-06-29 11:15   ` Christophe Leroy
2020-07-27  7:26 ` [PATCH v2 0/6] powerpc/32s: Allocate modules outside of vmalloc space for STRICT_KERNEL_RWX Michael Ellerman
2020-07-27  7:26   ` Michael Ellerman

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.