]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mips: fix compat_sys_lseek syscall
authorArnd Bergmann <arnd@arndb.de>
Thu, 20 Jun 2024 16:23:04 +0000 (18:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 27 Jul 2024 08:38:30 +0000 (10:38 +0200)
[ Upstream commit 0d5679a0aae2d8cda72169452c32e5cb88a7ab33 ]

This is almost compatible, but passing a negative offset should result
in a EINVAL error, but on mips o32 compat mode would seek to a large
32-bit byte offset.

Use compat_sys_lseek() to correctly sign-extend the argument.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/mips/kernel/syscalls/syscall_o32.tbl

index 353539ea4140a410fc258650a08544da05f9cd23..5f2c2636e7a4fcfaa5cb34aa83b0ae7ed1d7317f 100644 (file)
@@ -27,7 +27,7 @@
 17     o32     break                           sys_ni_syscall
 # 18 was sys_stat
 18     o32     unused18                        sys_ni_syscall
-19     o32     lseek                           sys_lseek
+19     o32     lseek                           sys_lseek                       compat_sys_lseek
 20     o32     getpid                          sys_getpid
 21     o32     mount                           sys_mount                       compat_sys_mount
 22     o32     umount                          sys_oldumount