diff options
author | Al Viro <viro@ZenIV.linux.org.uk> | 2012-12-02 12:55:07 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-02 13:46:38 -0500 |
commit | 9d73fc2d641f8831c9dc803177fe47c02120cc36 (patch) | |
tree | 266020ef9f36f1a9e09cb7c84d5058ff735575c1 | |
parent | 3c46f3d6406b1d0c53575774b2d1fd013cd7f76f (diff) |
open*(2) compat fixes (s390, arm64)
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>
-rw-r--r-- | arch/arm64/include/asm/unistd32.h | 2 | ||||
-rw-r--r-- | arch/s390/kernel/compat_wrapper.S | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index 6d909faebf28..656a6f291a35 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h | |||
@@ -392,7 +392,7 @@ __SYSCALL(367, sys_fanotify_init) | |||
392 | __SYSCALL(368, compat_sys_fanotify_mark_wrapper) | 392 | __SYSCALL(368, compat_sys_fanotify_mark_wrapper) |
393 | __SYSCALL(369, sys_prlimit64) | 393 | __SYSCALL(369, sys_prlimit64) |
394 | __SYSCALL(370, sys_name_to_handle_at) | 394 | __SYSCALL(370, sys_name_to_handle_at) |
395 | __SYSCALL(371, sys_open_by_handle_at) | 395 | __SYSCALL(371, compat_sys_open_by_handle_at) |
396 | __SYSCALL(372, sys_clock_adjtime) | 396 | __SYSCALL(372, sys_clock_adjtime) |
397 | __SYSCALL(373, sys_syncfs) | 397 | __SYSCALL(373, sys_syncfs) |
398 | 398 | ||
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index ad79b846535c..827e094a2f49 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -28,7 +28,7 @@ ENTRY(sys32_open_wrapper) | |||
28 | llgtr %r2,%r2 # const char * | 28 | llgtr %r2,%r2 # const char * |
29 | lgfr %r3,%r3 # int | 29 | lgfr %r3,%r3 # int |
30 | lgfr %r4,%r4 # int | 30 | lgfr %r4,%r4 # int |
31 | jg sys_open # branch to system call | 31 | jg compat_sys_open # branch to system call |
32 | 32 | ||
33 | ENTRY(sys32_close_wrapper) | 33 | ENTRY(sys32_close_wrapper) |
34 | llgfr %r2,%r2 # unsigned int | 34 | llgfr %r2,%r2 # unsigned int |