[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <918d999b-ecef-487a-a486-40b1d94beb15@ghiti.fr>
Date: Fri, 1 Aug 2025 10:29:28 +0200
From: Alexandre Ghiti <alex@...ti.fr>
To: liu.xuemei1@....com.cn, paul.walmsley@...ive.com
Cc: palmer@...belt.com, aou@...s.berkeley.edu,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RESEND] riscv: mmap(): use unsigned offset type in
riscv_sys_mmap
Hi Jessica,
On 8/1/25 04:49, liu.xuemei1@....com.cn wrote:
> From: Jessica Liu <liu.xuemei1@....com.cn>
>
> The variable type of offset should be consistent with the relevant
> interfaces of mmap which described in commit 295f10061af0 ("syscalls:
> mmap(): use unsigned offset type consistently). Otherwise, a user input
> with the top bit set would result in a negative page offset rather than a
> large one.
>
> Signed-off-by: Jessica Liu <liu.xuemei1@....com.cn>
> ---
> arch/riscv/kernel/sys_riscv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c
> index d77afe05578f..795b2e815ac9 100644
> --- a/arch/riscv/kernel/sys_riscv.c
> +++ b/arch/riscv/kernel/sys_riscv.c
> @@ -10,7 +10,7 @@
>
> static long riscv_sys_mmap(unsigned long addr, unsigned long len,
> unsigned long prot, unsigned long flags,
> - unsigned long fd, off_t offset,
> + unsigned long fd, unsigned long offset,
> unsigned long page_shift_offset)
> {
> if (unlikely(offset & (~PAGE_MASK >> page_shift_offset)))
> --
> 2.25.1
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
I had already merged this one for 6.17 but I did not say it so you could
not know, sorry about that, I'll do better next release.
Thanks for your patches,
Alex
Powered by blists - more mailing lists