diff options
author | Mark Rutland <mark.rutland@arm.com> | 2018-04-24 08:11:22 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2018-04-24 14:07:26 -0400 |
commit | 59275a0c037ed6fabd6354730f1e3104264ab719 (patch) | |
tree | 688a1724645587aef5210b600a979f9a9d57060b | |
parent | 907e21c15c883c2c15d1e5ee3cdbb7824ab1da59 (diff) |
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.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | arch/arm64/kernel/ptrace.c | 6 |
1 files changed, 0 insertions, 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, | |||
1458 | { | 1458 | { |
1459 | int ret; | 1459 | int ret; |
1460 | u32 kdata; | 1460 | u32 kdata; |
1461 | mm_segment_t old_fs = get_fs(); | ||
1462 | 1461 | ||
1463 | set_fs(KERNEL_DS); | ||
1464 | /* Watchpoint */ | 1462 | /* Watchpoint */ |
1465 | if (num < 0) { | 1463 | if (num < 0) { |
1466 | ret = compat_ptrace_hbp_get(NT_ARM_HW_WATCH, tsk, num, &kdata); | 1464 | 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, | |||
1471 | } else { | 1469 | } else { |
1472 | ret = compat_ptrace_hbp_get(NT_ARM_HW_BREAK, tsk, num, &kdata); | 1470 | ret = compat_ptrace_hbp_get(NT_ARM_HW_BREAK, tsk, num, &kdata); |
1473 | } | 1471 | } |
1474 | set_fs(old_fs); | ||
1475 | 1472 | ||
1476 | if (!ret) | 1473 | if (!ret) |
1477 | ret = put_user(kdata, data); | 1474 | ret = put_user(kdata, data); |
@@ -1484,7 +1481,6 @@ static int compat_ptrace_sethbpregs(struct task_struct *tsk, compat_long_t num, | |||
1484 | { | 1481 | { |
1485 | int ret; | 1482 | int ret; |
1486 | u32 kdata = 0; | 1483 | u32 kdata = 0; |
1487 | mm_segment_t old_fs = get_fs(); | ||
1488 | 1484 | ||
1489 | if (num == 0) | 1485 | if (num == 0) |
1490 | return 0; | 1486 | return 0; |
@@ -1493,12 +1489,10 @@ static int compat_ptrace_sethbpregs(struct task_struct *tsk, compat_long_t num, | |||
1493 | if (ret) | 1489 | if (ret) |
1494 | return ret; | 1490 | return ret; |
1495 | 1491 | ||
1496 | set_fs(KERNEL_DS); | ||
1497 | if (num < 0) | 1492 | if (num < 0) |
1498 | ret = compat_ptrace_hbp_set(NT_ARM_HW_WATCH, tsk, num, &kdata); | 1493 | ret = compat_ptrace_hbp_set(NT_ARM_HW_WATCH, tsk, num, &kdata); |
1499 | else | 1494 | else |
1500 | ret = compat_ptrace_hbp_set(NT_ARM_HW_BREAK, tsk, num, &kdata); | 1495 | ret = compat_ptrace_hbp_set(NT_ARM_HW_BREAK, tsk, num, &kdata); |
1501 | set_fs(old_fs); | ||
1502 | 1496 | ||
1503 | return ret; | 1497 | return ret; |
1504 | } | 1498 | } |