arm64/ptrace: Reject attempts to set incomplete hardware breakpoint fields
authorDave Martin <Dave.Martin@arm.com>
Wed, 18 Jan 2017 16:25:24 +0000 (16:25 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Jan 2017 07:23:49 +0000 (08:23 +0100)
commitc55f8aaf4a197c8bfeb9932d6d11ed2536d0b9b7
treebbeb4073771ddf15c269183736c1bc8e185a50d4
parent4c87fc7f20591ce8c4b6867b8ce3380c2caaaaac
arm64/ptrace: Reject attempts to set incomplete hardware breakpoint fields

commit ad9e202aa1ce571b1d7fed969d06f66067f8a086 upstream.

We cannot preserve partial fields for hardware breakpoints, because
the values written by userspace to the hardware breakpoint
registers can't subsequently be recovered intact from the hardware.

So, just reject attempts to write incomplete fields with -EINVAL.

Fixes: 478fcb2cdb23 ("arm64: Debugging support")
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Acked-by: Will Deacon <Will.Deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/ptrace.c