* [PATCH] arm64: ptrace: remove addr_limit manipulation
@ 2018-04-24 12:11 Mark Rutland
2018-04-24 17:03 ` Catalin Marinas
0 siblings, 1 reply; 2+ messages in thread
From: Mark Rutland @ 2018-04-24 12:11 UTC (permalink / raw)
To: linux-arm-kernel
We transiently switch to KERNEL_DS in compat_ptrace_gethbpregs() and
compat_ptrace_sethbpregs(), but in either case this is pointless as we
don't perform any uaccess during this window.
let's rip out the redundant addr_limit manipulation.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
---
arch/arm64/kernel/ptrace.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index 71d99af24ef2..7a832ce6552f 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -1458,9 +1458,7 @@ static int compat_ptrace_gethbpregs(struct task_struct *tsk, compat_long_t num,
{
int ret;
u32 kdata;
- mm_segment_t old_fs = get_fs();
- set_fs(KERNEL_DS);
/* Watchpoint */
if (num < 0) {
ret = compat_ptrace_hbp_get(NT_ARM_HW_WATCH, tsk, num, &kdata);
@@ -1471,7 +1469,6 @@ static int compat_ptrace_gethbpregs(struct task_struct *tsk, compat_long_t num,
} else {
ret = compat_ptrace_hbp_get(NT_ARM_HW_BREAK, tsk, num, &kdata);
}
- set_fs(old_fs);
if (!ret)
ret = put_user(kdata, data);
@@ -1484,7 +1481,6 @@ static int compat_ptrace_sethbpregs(struct task_struct *tsk, compat_long_t num,
{
int ret;
u32 kdata = 0;
- mm_segment_t old_fs = get_fs();
if (num == 0)
return 0;
@@ -1493,12 +1489,10 @@ static int compat_ptrace_sethbpregs(struct task_struct *tsk, compat_long_t num,
if (ret)
return ret;
- set_fs(KERNEL_DS);
if (num < 0)
ret = compat_ptrace_hbp_set(NT_ARM_HW_WATCH, tsk, num, &kdata);
else
ret = compat_ptrace_hbp_set(NT_ARM_HW_BREAK, tsk, num, &kdata);
- set_fs(old_fs);
return ret;
}
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] arm64: ptrace: remove addr_limit manipulation
2018-04-24 12:11 [PATCH] arm64: ptrace: remove addr_limit manipulation Mark Rutland
@ 2018-04-24 17:03 ` Catalin Marinas
0 siblings, 0 replies; 2+ messages in thread
From: Catalin Marinas @ 2018-04-24 17:03 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Apr 24, 2018 at 01:11:22PM +0100, Mark Rutland wrote:
> We transiently switch to KERNEL_DS in compat_ptrace_gethbpregs() and
> compat_ptrace_sethbpregs(), but in either case this is pointless as we
> don't perform any uaccess during this window.
>
> let's rip out the redundant addr_limit manipulation.
It looks like some leftovers from an internal tree prior to upstreaming.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-04-24 17:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-24 12:11 [PATCH] arm64: ptrace: remove addr_limit manipulation Mark Rutland
2018-04-24 17:03 ` Catalin Marinas
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.