Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1565707
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 4.4 34/42] arm64/ptrace: Reject attempts to set incomplete hardware breakpoint fields |
| Date | 2017-01-24 09:40 +0100 |
| Message-ID | <t34O0-1Xv-69@gated-at.bofh.it> (permalink) |
| References | <t34bf-1t2-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Martin <Dave.Martin@arm.com>
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 | 4 ++++
1 file changed, 4 insertions(+)
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -450,6 +450,8 @@ static int hw_break_set(struct task_stru
/* (address, ctrl) registers */
limit = regset->n * regset->size;
while (count && offset < limit) {
+ if (count < PTRACE_HBP_ADDR_SZ)
+ return -EINVAL;
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &addr,
offset, offset + PTRACE_HBP_ADDR_SZ);
if (ret)
@@ -459,6 +461,8 @@ static int hw_break_set(struct task_stru
return ret;
offset += PTRACE_HBP_ADDR_SZ;
+ if (!count)
+ break;
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &ctrl,
offset, offset + PTRACE_HBP_CTRL_SZ);
if (ret)
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 4.4 00/42] 4.4.45-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-24 09:40 +0100 [PATCH 4.4 02/42] IB/mlx5: Wait for all async command completions to complete Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-24 09:40 +0100 [PATCH 4.4 29/42] ARM: dts: da850-evm: fix read access to SPI flash Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-24 09:40 +0100 [PATCH 4.4 05/42] IB/mlx4: Fix port query for 56Gb Ethernet links Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-24 09:40 +0100 [PATCH 4.4 09/42] ARM: dts: imx31: fix clock control module interrupts description Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-24 09:40 +0100 [PATCH 4.4 37/42] ARM: 8613/1: Fix the uaccess crash on PB11MPCore Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-24 09:40 +0100 [PATCH 4.4 32/42] arm64/ptrace: Preserve previous registers for short regset write - 3 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-24 09:40 +0100 [PATCH 4.4 35/42] ARM: dts: imx6qdl-nitrogen6_max: fix sgtl5000 pinctrl init Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-24 09:40 +0100 [PATCH 4.4 14/42] svcrpc: dont leak contexts on PROC_DESTROY Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-24 09:40 +0100 [PATCH 4.4 24/42] ubifs: Fix journal replay wrt. xattr nodes Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-24 09:40 +0100 [PATCH 4.4 03/42] IB/mlx4: Set traffic class in AH Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-24 09:40 +0100 [PATCH 4.4 42/42] arm64: avoid returning from bad_mode Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-24 09:40 +0100 [PATCH 4.4 39/42] [media] ite-cir: initialize use_demodulator before using it Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-24 09:40 +0100 [PATCH 4.4 28/42] ceph: fix bad endianness handling in parse_reply_info_extra Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-24 09:40 +0100 [PATCH 4.4 31/42] arm64/ptrace: Preserve previous registers for short regset write - 2 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-24 09:40 +0100 [PATCH 4.4 34/42] arm64/ptrace: Reject attempts to set incomplete hardware breakpoint fields Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-24 09:40 +0100 [PATCH 4.4 16/42] PCI: Enumerate switches below PCI-to-PCIe bridges Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-24 09:50 +0100 Re: [PATCH 4.4 00/42] 4.4.45-stable review Shuah Khan <shuah.kh@samsung.com> - 2017-01-24 19:30 +0100 Re: [PATCH 4.4 00/42] 4.4.45-stable review Guenter Roeck <linux@roeck-us.net> - 2017-01-24 20:10 +0100
csiph-web