Skip to content

Commit 881cb34

Browse files
Jessica LiuRevySR
authored andcommitted
FROMLIST: riscv: mmap(): use unsigned offset type in riscv_sys_mmap
The variable type of offset should be consistent with the relevant interfaces of mmap which described in commit 295f100 ("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 <[email protected]> Reviewed-by: Alexandre Ghiti <[email protected]> Reviewed-by: Nutty Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Han Gao <[email protected]>
1 parent e3e2c55 commit 881cb34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/kernel/sys_riscv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
static long riscv_sys_mmap(unsigned long addr, unsigned long len,
1212
unsigned long prot, unsigned long flags,
13-
unsigned long fd, off_t offset,
13+
unsigned long fd, unsigned long offset,
1414
unsigned long page_shift_offset)
1515
{
1616
if (unlikely(offset & (~PAGE_MASK >> page_shift_offset)))

0 commit comments

Comments
 (0)