OSDN Git Service

arm64: fix possible spectre-v1 write in ptrace_hbp_set_event()
authorMark Rutland <mark.rutland@arm.com>
Tue, 10 Jul 2018 18:01:22 +0000 (19:01 +0100)
committerWill Deacon <will.deacon@arm.com>
Mon, 23 Jul 2018 13:49:14 +0000 (14:49 +0100)
commit14d6e289a89780377f8bb09de8926d3c62d763cd
tree7d8c11258a34c3d2576122ff5566c62456f98f59
parent11527b3e0b577513ea318f01e392ccf7feb9d2a4
arm64: fix possible spectre-v1 write in ptrace_hbp_set_event()

It's possible for userspace to control idx. Sanitize idx when using it
as an array index, to inhibit the potential spectre-v1 write gadget.

Found by smatch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/ptrace.c