diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> | 2020-11-27 05:44:15 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-12-03 15:01:26 +0100 |
commit | edc541ecaae73d498a49b9ca82bc66255d9e0720 (patch) | |
tree | 42ac724d9546bdda91b0e7b63aecc43b874a929b /arch/powerpc/kernel/ptrace | |
parent | powerpc/book3s64/pkeys: Reset userspace AMR correctly on exec (diff) | |
download | linux-edc541ecaae73d498a49b9ca82bc66255d9e0720.tar.xz linux-edc541ecaae73d498a49b9ca82bc66255d9e0720.zip |
powerpc/ptrace-view: Use pt_regs values instead of thread_struct based one.
We will remove thread.amr/iamr/uamor in a later patch
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201127044424.40686-14-aneesh.kumar@linux.ibm.com
Diffstat (limited to 'arch/powerpc/kernel/ptrace')
-rw-r--r-- | arch/powerpc/kernel/ptrace/ptrace-view.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/ptrace/ptrace-view.c b/arch/powerpc/kernel/ptrace/ptrace-view.c index 00a765f00d31..2bad8068f598 100644 --- a/arch/powerpc/kernel/ptrace/ptrace-view.c +++ b/arch/powerpc/kernel/ptrace/ptrace-view.c @@ -471,12 +471,12 @@ static int pkey_active(struct task_struct *target, const struct user_regset *reg static int pkey_get(struct task_struct *target, const struct user_regset *regset, struct membuf to) { - BUILD_BUG_ON(TSO(amr) + sizeof(unsigned long) != TSO(iamr)); if (!arch_pkeys_enabled()) return -ENODEV; - membuf_write(&to, &target->thread.amr, 2 * sizeof(unsigned long)); + membuf_store(&to, target->thread.regs->amr); + membuf_store(&to, target->thread.regs->iamr); return membuf_store(&to, default_uamor); } @@ -509,7 +509,8 @@ static int pkey_set(struct task_struct *target, const struct user_regset *regset * Pick the AMR values for the keys that kernel is using. This * will be indicated by the ~default_uamor bits. */ - target->thread.amr = (new_amr & default_uamor) | (target->thread.amr & ~default_uamor); + target->thread.regs->amr = (new_amr & default_uamor) | + (target->thread.regs->amr & ~default_uamor); return 0; } |