From: <Conor.Dooley@microchip.com>
To: <huqi@loongson.cn>, <chenhuacai@kernel.org>, <kernel@xen0n.name>,
<oleg@redhat.com>
Cc: <lixu@loongson.cn>, <loongarch@lists.linux.dev>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] LoongArch: Fix missing fcsr in ptrace's fpr_set
Date: Thu, 14 Jul 2022 06:51:09 +0000 [thread overview]
Message-ID: <6bc55cd5-bb6e-8d4a-79ec-4555c0b7765b@microchip.com> (raw)
In-Reply-To: <20220714062550.4934-1-huqi@loongson.cn>
On 14/07/2022 07:25, Qi Hu wrote:
> In file ptrace.c, function fpr_set does not copy fcsr data from ubuf
> to kbuf. That's the reason why fcsr cannot be modified by ptrace.
>
> This patch fixs this problem and allows users using ptrace to modify
> the fcsr.
>
> Signed-off-by: Qi Hu <huqi@loongson.cn>
> Signed-off-by: Xu Li <lixu@loongson.cn>
Hey Qi Hu,
Why does this have Xu Li's SoB if they're neither the author nor listed
as a Co-developed-by:?
As submitter, your SoB should be last anyway.
Thanks,
Conor.
> ---
> arch/loongarch/kernel/ptrace.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/arch/loongarch/kernel/ptrace.c b/arch/loongarch/kernel/ptrace.c
> index e6ab87948e1d..dc2b82ea894c 100644
> --- a/arch/loongarch/kernel/ptrace.c
> +++ b/arch/loongarch/kernel/ptrace.c
> @@ -193,7 +193,7 @@ static int fpr_set(struct task_struct *target,
> const void *kbuf, const void __user *ubuf)
> {
> const int fcc_start = NUM_FPU_REGS * sizeof(elf_fpreg_t);
> - const int fcc_end = fcc_start + sizeof(u64);
> + const int fcsr_start = fcc_start + sizeof(u64);
> int err;
>
> BUG_ON(count % sizeof(elf_fpreg_t));
> @@ -209,10 +209,12 @@ static int fpr_set(struct task_struct *target,
> if (err)
> return err;
>
> - if (count > 0)
> - err |= user_regset_copyin(&pos, &count, &kbuf, &ubuf,
> - &target->thread.fpu.fcc,
> - fcc_start, fcc_end);
> + err |= user_regset_copyin(&pos, &count, &kbuf, &ubuf,
> + &target->thread.fpu.fcc, fcc_start,
> + fcc_start + sizeof(u64));
> + err |= user_regset_copyin(&pos, &count, &kbuf, &ubuf,
> + &target->thread.fpu.fcsr, fcsr_start,
> + fcsr_start + sizeof(u32));
>
> return err;
> }
next prev parent reply other threads:[~2022-07-14 6:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-14 6:25 Qi Hu
2022-07-14 6:51 ` Conor.Dooley [this message]
2022-07-14 7:14 ` Qi Hu
2022-07-14 13:12 ` Huacai Chen
2022-07-14 14:07 ` Qi Hu
2022-07-15 3:20 ` Huacai Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6bc55cd5-bb6e-8d4a-79ec-4555c0b7765b@microchip.com \
--to=conor.dooley@microchip.com \
--cc=chenhuacai@kernel.org \
--cc=huqi@loongson.cn \
--cc=kernel@xen0n.name \
--cc=linux-kernel@vger.kernel.org \
--cc=lixu@loongson.cn \
--cc=loongarch@lists.linux.dev \
--cc=oleg@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®