mbox series

[v3,0/4] arm64: compat: Add kuser helpers config option

Message ID 20190402162757.13491-1-vincenzo.frascino@arm.com (mailing list archive)
Headers show
Series arm64: compat: Add kuser helpers config option | expand

Message

Vincenzo Frascino April 2, 2019, 4:27 p.m. UTC
Currently on arm64 compat kuser helper are enabled by default.

To be on pair with arm32, this patchset makes it possible to disable
the kuser helpers by adding a CONFIG_KUSER_HELPERS option which is
enabled by default to avoid compatibility issues.

When the config option is disabled:
 - The kuser helpers-related code is not compiled with the kernel.
 - The kuser helpers mapping, for any compat process, at 0xffff0000
   is not done.
 - Any attempt to use a kuser helper from a compat process will result
   in a segfault.

Changes:
--------
v3:
  - Fix aarch32_alloc_vdso_pages()
v2:
  - Rebased on 5.1-rc3.
  - Addressed review comments.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>

Vincenzo Frascino (4):
  arm64: compat: Alloc separate pages for vectors and sigpage
  arm64: compat: Split kuser32
  arm64: compat: Refactor aarch32_alloc_vdso_pages()
  arm64: compat: Add KUSER_HELPERS config option

 arch/arm64/Kconfig                 |  28 +++++
 arch/arm64/include/asm/elf.h       |   6 +-
 arch/arm64/include/asm/processor.h |   4 +-
 arch/arm64/include/asm/signal32.h  |   2 -
 arch/arm64/kernel/Makefile         |   5 +-
 arch/arm64/kernel/kuser32.S        |  66 ++----------
 arch/arm64/kernel/signal32.c       |   5 +-
 arch/arm64/kernel/sigreturn32.S    |  46 ++++++++
 arch/arm64/kernel/vdso.c           | 165 +++++++++++++++++++++++------
 9 files changed, 225 insertions(+), 102 deletions(-)
 create mode 100644 arch/arm64/kernel/sigreturn32.S