diff options
author | Arnd Bergmann <arnd@arndb.de> | 2024-06-04 15:20:26 +0300 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2024-06-25 16:57:38 +0300 |
commit | 295f10061af024099440b46602bcc47364551db7 (patch) | |
tree | d10e0927976e4a9fc727be88fabf80911da88232 /arch/loongarch | |
parent | 5daf62da52ecd5761d63cbb6489eb434645547df (diff) | |
download | linux-295f10061af024099440b46602bcc47364551db7.tar.xz |
syscalls: mmap(): use unsigned offset type consistently
Most architectures that implement the old-style mmap() with byte offset
use 'unsigned long' as the type for that offset, but microblaze and
riscv have the off_t type that is shared with userspace, matching the
prototype in include/asm-generic/syscalls.h.
Make this consistent by using an unsigned argument everywhere. This
changes the behavior slightly, as the argument is shifted to a page
number, and an user input with the top bit set would result in a
negative page offset rather than a large one as we use elsewhere.
For riscv, the 32-bit sys_mmap2() definition actually used a custom
type that is different from the global declaration, but this was
missed due to an incorrect type check.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/loongarch')
-rw-r--r-- | arch/loongarch/kernel/syscall.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/loongarch/kernel/syscall.c b/arch/loongarch/kernel/syscall.c index b4c5acd7aa3b..8801611143ab 100644 --- a/arch/loongarch/kernel/syscall.c +++ b/arch/loongarch/kernel/syscall.c @@ -22,7 +22,7 @@ #define __SYSCALL(nr, call) [nr] = (call), SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len, unsigned long, - prot, unsigned long, flags, unsigned long, fd, off_t, offset) + prot, unsigned long, flags, unsigned long, fd, unsigned long, offset) { if (offset & ~PAGE_MASK) return -EINVAL; |