objtool: UACCESS validation v3
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest20 patches 76 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/20 | x86/ia32: Fix ia32_restore_sigcontext AC leakarch/ | +17 | 0 replies | |
| 2/20 | i915,uaccess: Fix redundant CLACdrivers/ | +4 | 0 replies | |
| 3/20 | x86/uaccess: Move copy_user_handle_tail into asmarch/ arch/ arch/ +1 more | +48 | 4 replies | |
| 4/20 | x86/uaccess: Fix up the fixuparch/ | +2 | 0 replies | |
| 5/20 | x86/uaccess/xen: Suppress SMAP warningsarch/ | +22 | 8 replies | |
| 6/20 | x86/uaccess: Always inline user_access_begin()arch/ | +1 | 0 replies | |
| 7/20 | x86/uaccess: Always inline force_valid_ss()arch/ | +1 | 4 replies | |
| 8/20 | x86/uaccess: Introduce user_access_{save,restore}()arch/ arch/ include/ | +25 | 0 replies | |
| 9/20 | x86/uaccess,kasan: Fix KASAN vs SMAPmm/ mm/ mm/ | +14 | 0 replies | |
| 10/20 | x86/uaccess,ubsan: Fix UBSAN vs SMAPlib/ lib/ | +5 | 0 replies | |
| 11/20 | x86/uaccess,ftrace: Fix ftrace_likely_update() vs SMAPkernel/ | +4 | 0 replies | |
| 12/20 | objtool: Set insn->func for alternativestools/ | +1 | 2 replies | |
| 13/20 | objtool: Hande function aliasestools/ tools/ | +12 | 3 replies | |
| 14/20 | objtool: Rewrite add_ignores()tools/ tools/ | +20 | 1 reply | |
| 15/20 | objtool: Add --backtrace supporttools/ tools/ tools/ +1 more | +25 | 1 reply | |
| 16/20 | objtool: Rewrite alt->skip_origtools/ | +10 | 3 replies | |
| 17/20 | objtool: Fix sibling call detectiontools/ | +46 | 1 reply | |
| 18/20 | objtool: Add UACCESS validationscripts/ tools/ tools/ +6 more | +188 | 22 replies | |
| 19/20 | objtool: uaccess PUSHF/POPF supporttools/ tools/ tools/ +1 more | +31 | 2 replies | |
| 20/20 | objtool: Add Direction Flag validationtools/ tools/ tools/ +1 more | +37 | 5 replies |
Reviews trailers per patch
2 of 20 patches have a Reviewed-by or Acked-by.
| Patch | Juergen Gross | Andy Lutomirski |
|---|---|---|
| 1/20 | ||
| 2/20 | ||
| 3/20 | ||
| 4/20 | ||
| 5/20 | R-b | |
| 6/20 | ||
| 7/20 | R-b | |
| 8/20 | ||
| 9/20 | ||
| 10/20 | ||
| 11/20 | ||
| 12/20 | ||
| 13/20 | ||
| 14/20 | ||
| 15/20 | ||
| 16/20 | ||
| 17/20 | ||
| 18/20 | ||
| 19/20 | ||
| 20/20 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/20] objtool: UACCESS validation v3
Teach objtool to validate the UACCESS (SMAP, PAN) rules with are currently unenforced and (therefore obviously) violated.
UACCESS sections should be small; we want to limit the amount of code that can touch userspace. Furthermore, UACCESS state isn't scheduled, this means that anything that directly calls into the scheduler will result in random code running with UACCESS enabled and possibly getting back into the UACCESS region with UACCESS disabled and causing faults.
Forbid any CALL/RET while UACCESS is enabled; but provide a few exceptions.
This builds x86_64-allmodconfig clean, and I've only got a few randconfig failures left (GCC-8) that I'm not quite understanding.
--- arch/x86/ia32/ia32_signal.c | 29 ++- arch/x86/include/asm/asm.h | 24 -- arch/x86/include/asm/nospec-branch.h | 4 +- arch/x86/include/asm/smap.h | 20 ++ arch/x86/include/asm/uaccess.h | 5 +- arch/x86/include/asm/uaccess_64.h | 3 - arch/x86/include/asm/xen/hypercall.h | 26 +- arch/x86/kernel/signal.c | 2 +- arch/x86/lib/copy_user_64.S | 48 ++++ arch/x86/lib/memcpy_64.S | 3 +- arch/x86/lib/usercopy_64.c | 20 -- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 6 +- include/linux/uaccess.h | 2 + kernel/trace/trace_branch.c | 4 + lib/Makefile | 1 + lib/ubsan.c | 4 + mm/kasan/Makefile | 3 + mm/kasan/common.c | 10 + mm/kasan/report.c | 3 +- scripts/Makefile.build | 3 + tools/objtool/Makefile | 2 +- tools/objtool/arch.h | 8 +- tools/objtool/arch/x86/decode.c | 26 +- tools/objtool/builtin-check.c | 4 +- tools/objtool/builtin.h | 2 +- tools/objtool/check.c | 382 ++++++++++++++++++++++------- tools/objtool/check.h | 4 +- tools/objtool/elf.c | 15 +- tools/objtool/elf.h | 3 +- tools/objtool/special.c | 10 +- tools/objtool/warn.h | 8 + 31 files changed, 511 insertions(+), 173 deletions(-)