OSDN Git Service

arm64: entry: Ensure branch through syscall table is bounded under speculation
authorWill Deacon <will.deacon@arm.com>
Mon, 5 Feb 2018 15:34:20 +0000 (15:34 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2018 19:22:51 +0000 (20:22 +0100)
commit7a51d7d2f7f77cea72fe0f73bd40d39852cd0702
tree26649877ced7f41a651813ac8985a2ca8475a54b
parent2e985d2647a07bad21892811e8eb85f5231a1d4a
arm64: entry: Ensure branch through syscall table is bounded under speculation

Commit 6314d90e6493 upstream.

In a similar manner to array_index_mask_nospec, this patch introduces an
assembly macro (mask_nospec64) which can be used to bound a value under
speculation. This macro is then used to ensure that the indirect branch
through the syscall table is bounded under speculation, with out-of-range
addresses speculating as calls to sys_io_setup (0).

Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/include/asm/assembler.h
arch/arm64/kernel/entry.S