Thread (49 messages) flat view 49 messages, 7 authors, 2022-11-03

Re: [PATCH] powerpc/32: fix syscall wrappers with 64-bit arguments

From: "Arnd Bergmann" <arnd@arndb.de>
Date: 2022-10-31 19:39:47

On Mon, Oct 31, 2022, at 15:47, Andreas Schwab wrote:
With the introducion of syscall wrappers all wrappers for syscalls with
64-bit arguments must be handled specially, not only those that have
unaligned 64-bit arguments.  This left out the fallocate and
sync_file_range2 syscalls.

Fixes: 7e92e01b7245 ("powerpc: Provide syscall wrapper")
Fixes: e23750623835 ("powerpc/32: fix syscall wrappers with 64-bit 
arguments of unaligned register-pairs")
Signed-off-by: Andreas Schwab <redacted>
This looks correct as a minmal bugfix to be backported.
I have cross-checked the syscalls with 64-bit arguments that
have special handlers on powerpc against the list from x86
to make sure there are no other obvious ones that need a
similar fix.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
+
+#ifdef CONFIG_PPC32
+SYSCALL_DEFINE6(ppc_fallocate,
+		int, fd, int, mode,
+		u32, offset1, u32, offset2, u32, len1, u32, len2)
+{
+	return ksys_fallocate(fd, mode,
+			      merge_64(offset1, offset2),
+			      merge_64(len1, len2));
+}
+#endif
This is identical to compat_sys_fallocate() and to
(an andian-corrected) sys_ia32_fallocate(), right?

I still think we should eventually generalize this further and
make all these handlers architecture independent to prevent the
same bug from happening on additional architectures, but that
should probably be done separately.

     Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help