Skip to content

vsyscall xonly mode

Andy Lutomirski kernel-hardening lkml stable 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 8 repliesIn review
  2. v15 patches 7 repliesSuperseded

Changes in v2 from the cover letter

- Minor cleanups (Kees)
- Add a searchable message when a vsyscall read is denied (Kees)
- The test case is vastly improved
- Get rid of the extra gate vma object
- Add the __ro_after_init patch

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8x86/vsyscall: Remove the vsyscall=native documentationDocumentation/admin-guide/kernel-parameters.txt+0 -61 reply
2/8x86/vsyscall: Add a new vsyscall=xonly modeDocumentation/admin-guide/kernel-parameters.txt arch/x86/Kconfig arch/x86/entry/vsyscall/vsyscall_64.c+44 -121 reply
3/8x86/vsyscall: Show something useful on a read faultarch/x86/entry/vsyscall/vsyscall_64.c arch/x86/include/asm/vsyscall.h arch/x86/mm/fault.c+27 -91 reply
4/8x86/vsyscall: Document odd SIGSEGV error code for vsyscallsarch/x86/mm/fault.c tools/testing/selftests/x86/test_vsyscall.c+15 -11 reply
5/8selftests/x86/vsyscall: Verify that vsyscall=none blocks executiontools/testing/selftests/x86/test_vsyscall.c+52 -241 reply
6/8x86/vsyscall: Change the default vsyscall mode to xonlyarch/x86/Kconfig+1 -11 reply
7/8x86/vsyscall: Add __ro_after_init to global variablesarch/x86/entry/vsyscall/vsyscall_64.c+2 -21 reply
8/8selftests/x86: Add a test for process_vm_readv() on the vsyscall pagetools/testing/selftests/x86/test_vsyscall.c+35 -01 reply

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchKees Cook
1/8A-b
2/8R-b
3/8R-b
4/8R-b
5/8R-b
6/8R-b
7/8R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/8] vsyscall xonly mode

Hi all-

This adds a new "xonly" mode for vsyscalls and makes it the default. xonly is a bit more secure -- Kees knows about an exploit that relied on read access to the vsyscall page. It's also nicer from a paging perspective, as it doesn't require user access to any of the kernel address space as far as the CPU is concerned. This would, for example, allow a much simpler implementation of per-process vsyscall disabling.

I will follow up with two non-x86 changes that are related but have no dependencies.

Changes from v1:
- Minor cleanups (Kees)
- Add a searchable message when a vsyscall read is denied (Kees)
- The test case is vastly improved
- Get rid of the extra gate vma object
- Add the __ro_after_init patch

Andy Lutomirski (8):
x86/vsyscall: Remove the vsyscall=native documentation x86/vsyscall: Add a new vsyscall=xonly mode
x86/vsyscall: Show something useful on a read fault x86/vsyscall: Document odd SIGSEGV error code for vsyscalls selftests/x86/vsyscall: Verify that vsyscall=none blocks execution x86/vsyscall: Change the default vsyscall mode to xonly x86/vsyscall: Add __ro_after_init to global variables selftests/x86: Add a test for process_vm_readv() on the vsyscall page

 .../admin-guide/kernel-parameters.txt         |  11 +-
 arch/x86/Kconfig                              |  35 +++--
 arch/x86/entry/vsyscall/vsyscall_64.c         |  37 +++++-
 arch/x86/include/asm/vsyscall.h               |   6 +-
 arch/x86/mm/fault.c                           |  18 ++-
 tools/testing/selftests/x86/test_vsyscall.c   | 120 ++++++++++++++----
 6 files changed, 174 insertions(+), 53 deletions(-)
Signature · 1 line
2.21.0