open*(2) compat fixes (s390, arm64)
authorAl Viro <viro@ZenIV.linux.org.uk>
Sun, 2 Dec 2012 17:55:07 +0000 (17:55 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 2 Dec 2012 18:46:38 +0000 (10:46 -0800)
The usual rules for open()/openat()/open_by_handle_at() are
 1) native 32bit - don't force O_LARGEFILE in flags
 2) native 64bit - force O_LARGEFILE in flags
 3) compat on 64bit host - as for native 32bit
 4) native 32bit ABI for 64bit system (mips/n32, x86/x32) - as for
    native 64bit

There are only two exceptions - s390 compat has open() forcing
O_LARGEFILE and arm64 compat has open_by_handle_at() doing the same
thing.  The same binaries on native host (s390/31 and arm resp.) will
*not* force O_LARGEFILE, so IMO both are emulation bugs.

Objections? The fix is obvious...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/arm64/include/asm/unistd32.h
arch/s390/kernel/compat_wrapper.S

index 6d909faebf28d155020ef96e17654d5ae74bed6f..656a6f291a35195bc697a1f5e5112af7f1eab356 100644 (file)
@@ -392,7 +392,7 @@ __SYSCALL(367, sys_fanotify_init)
 __SYSCALL(368, compat_sys_fanotify_mark_wrapper)
 __SYSCALL(369, sys_prlimit64)
 __SYSCALL(370, sys_name_to_handle_at)
-__SYSCALL(371, sys_open_by_handle_at)
+__SYSCALL(371, compat_sys_open_by_handle_at)
 __SYSCALL(372, sys_clock_adjtime)
 __SYSCALL(373, sys_syncfs)
 
index ad79b846535c4d9345e884341f40481e9d38c492..827e094a2f494d09bdf1936cde25df431ec7c012 100644 (file)
@@ -28,7 +28,7 @@ ENTRY(sys32_open_wrapper)
        llgtr   %r2,%r2                 # const char *
        lgfr    %r3,%r3                 # int
        lgfr    %r4,%r4                 # int
-       jg      sys_open                # branch to system call
+       jg      compat_sys_open         # branch to system call
 
 ENTRY(sys32_close_wrapper)
        llgfr   %r2,%r2                 # unsigned int