arm64: ptrace: remove addr_limit manipulation
Subsystems (2)
Mark Rutland
reviewerPATCH 1/1 arm64: ptrace: remove addr_limit manipulation
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 <[email protected]>
Cc Will Deacon <[email protected]>
--- arch/arm64/kernel/ptrace.c | 6 ------ 1 file changed, 6 deletions(-)
arch/arm64/kernel/ptrace.c +0 -6
@@ -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; }
Signature · 1 line
2.11.0
Catalin Marinas
maintainerPATCH 1/1 arm64: ptrace: remove addr_limit manipulation
Quoted 5 lines · Mark Rutland
We transiently switch to
KERNEL_DSincompat_ptrace_gethbpregs()andcompat_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_limitmanipulation.
It looks like some leftovers from an internal tree prior to upstreaming.
Acked-by Catalin Marinas <[email protected]>