Skip to content

Possible MPX improvements for 3.19

Andy Lutomirski lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 24 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3x86, mpx: Check user mode bitness correctly when decoding instructionsarch/x86/include/asm/ptrace.h arch/x86/mm/mpx.c+6 -12 replies
2/3x86, mpx: Short-circuit the instruction decoder for unexpected opcodesarch/x86/mm/mpx.c+17 -91 reply
3/3x86, mpx: Change the MPX enable/disable API to arch_prctlarch/x86/include/uapi/asm/prctl.h arch/x86/kernel/process_64.c include/uapi/linux/prctl.h +1 more+21 -2221 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 3.19 0/3] Possible MPX improvements for 3.19

I don't have the hardware, so this is only compile-tested.

Patches 1 and 2 should be safe. Patch 1 is a bugfix, although given the bitness sensitivity of the MPX data structures, any user code that hits the bug is probably doomed to failure anyway. Patch 2 is a hardening change that adds almost no complexity (it's mostly just reordering some code) that will make it considerably harder to exploit a possibly insn decoder vulnerability using threads that modify MPX instructions that send #BR before the trap handler runs.

Patch 3 will be much more controversial, since it's a complete ABI break. The ABI in question has never appeared in a released kernel, though. If patch 3 is not okay, then I want to fix the prctl implementation to at least validate its arguments.

Andy Lutomirski (3):
x86, mpx: Check user mode bitness correctly when decoding instructions x86, mpx: Short-circuit the instruction decoder for unexpected opcodes x86, mpx: Change the MPX enable/disable API to arch_prctl

 arch/x86/include/asm/ptrace.h     |  5 +++++
 arch/x86/include/uapi/asm/prctl.h | 15 +++++++++++----
 arch/x86/kernel/process_64.c      | 10 ++++++++++
 arch/x86/mm/mpx.c                 | 28 ++++++++++++++++++----------
 include/uapi/linux/prctl.h        |  6 ------
 kernel/sys.c                      | 12 ------------
 6 files changed, 44 insertions(+), 32 deletions(-)
Signature · 1 line
2.1.0