Skip to content

Mitigations against spectre-v1 in the arm64 Linux kernel

Will Deacon linux-arm-kernel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9arm64: barrier: Add CSDB macros to control data-value predictionarch/arm64/include/asm/assembler.h arch/arm64/include/asm/barrier.h+8 -00 replies
2/9arm64: Implement array_index_mask_nospec()arch/arm64/include/asm/barrier.h+21 -00 replies
3/9arm64: Make USER_DS an inclusive limitarch/arm64/include/asm/processor.h arch/arm64/include/asm/uaccess.h arch/arm64/kernel/entry.S +1 more+33 -230 replies
4/9arm64: Use pointer masking to limit uaccess speculationarch/arm64/include/asm/uaccess.h+23 -30 replies
5/9arm64: entry: Ensure branch through syscall table is bounded under speculationarch/arm64/include/asm/assembler.h arch/arm64/kernel/entry.S+13 -00 replies
6/9arm64: uaccess: Prevent speculative use of the current addr_limitarch/arm64/include/asm/uaccess.h+7 -00 replies
7/9arm64: uaccess: Don't bother eliding access_ok checks in __{get, put}_userarch/arm64/include/asm/uaccess.h+32 -220 replies
8/9arm64: uaccess: Mask __user pointers for __arch_{clear, copy_*}_userarch/arm64/include/asm/uaccess.h arch/arm64/kernel/arm64ksyms.c arch/arm64/lib/clear_user.S +1 more+30 -140 replies
9/9arm64: futex: Mask __user pointers prior to dereferencearch/arm64/include/asm/futex.h+6 -30 replies

Reviews trailers per patch

5 of 9 patches have a Reviewed-by or Acked-by.

PatchMark RutlandRobin Murphy
1/9R-b
2/9R-b
3/9
4/9
5/9R-b
6/9R-b
7/9R-b
8/9
9/9

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

Read the v1 thread

Cover letter [PATCH 0/9] Mitigations against spectre-v1 in the arm64 Linux kernel

Hi all,

This series implements some mitigations against spectre-v1 for arm64. It broadly follows the work that has been done for x86, by implementing:

* A back-end version of array_index_mask_nospec() to suppress any compiler optimisations that could introduce unwanted speculative paths

* Masking of the syscall number to restrict speculation through the syscall table

* Masking of __user pointers prior to deference in uaccess routines

The latter introduces complications in access_ok and set_fs which are also handled in this series.

Cheers,

Will

--->8

Robin Murphy (3):
arm64: Implement array_index_mask_nospec()
arm64: Make USER_DS an inclusive limit
arm64: Use pointer masking to limit uaccess speculation

Will Deacon (6):
arm64: barrier: Add CSDB macros to control data-value prediction
arm64: entry: Ensure branch through syscall table is bounded under
speculation
arm64: uaccess: Prevent speculative use of the current addr_limit
arm64: uaccess: Don't bother eliding access_ok checks in

    __{get,put}_user

arm64: uaccess: Mask __user pointers for __arch_{clear,copy_*}_user
arm64: futex: Mask __user pointers prior to dereference

 arch/arm64/include/asm/assembler.h |  18 +++++
 arch/arm64/include/asm/barrier.h   |  22 ++++++
 arch/arm64/include/asm/futex.h     |   9 ++-
 arch/arm64/include/asm/processor.h |   3 +
 arch/arm64/include/asm/uaccess.h   | 155 +++++++++++++++++++++++++------------
 arch/arm64/kernel/arm64ksyms.c     |   4 +-
 arch/arm64/kernel/entry.S          |   6 +-
 arch/arm64/lib/clear_user.S        |   6 +-
 arch/arm64/lib/copy_in_user.S      |   5 +-
 arch/arm64/mm/fault.c              |   4 +-
 10 files changed, 170 insertions(+), 62 deletions(-)
Signature · 1 line
2.1.4