[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8f3d86e4-f051-2cf8-d5ec-f1046632bbda@loongson.cn>
Date: Thu, 14 Jul 2022 15:14:59 +0800
From: Qi Hu <huqi@...ngson.cn>
To: Conor.Dooley@...rochip.com, chenhuacai@...nel.org,
kernel@...0n.name, oleg@...hat.com
Cc: lixu@...ngson.cn, loongarch@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] LoongArch: Fix missing fcsr in ptrace's fpr_set
On 2022/7/14 14:51, Conor.Dooley@...rochip.com wrote:
> 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@...ngson.cn>
>> Signed-off-by: Xu Li <lixu@...ngson.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.
>
Ops. I realize using SoB here is incorrect. I will change it into
Co-developed-by.
Thanks.
Qi.
>> ---
>> 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;
>> }
Powered by blists - more mailing lists