diff options
author | Andi Kleen <ak@suse.de> | 2007-06-20 06:23:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-06-20 17:27:25 -0400 |
commit | e412ac4971d27ea84f3d63ce425c6ab2d6a67f23 (patch) | |
tree | e73b08d0114f5cc63ad8f44f4e11434abc8f642f /arch | |
parent | 7c8545e98468c53809fc06788a3b9a34dff05240 (diff) |
x86_64: Fix readahead/sync_file_range/fadvise64 compat calls
Correctly convert the u64 arguments from 32bit to 64bit.
Pointed out by Heiko Carstens.
I guess this proves Linus' theory that nobody uses the more exotic Linux
specific syscalls. It wasn't discovered by a user.
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86_64/ia32/ia32entry.S | 6 | ||||
-rw-r--r-- | arch/x86_64/ia32/sys_ia32.c | 19 |
2 files changed, 22 insertions, 3 deletions
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S index 21868f9bed7c..47565c3345d2 100644 --- a/arch/x86_64/ia32/ia32entry.S +++ b/arch/x86_64/ia32/ia32entry.S | |||
@@ -620,7 +620,7 @@ ia32_sys_call_table: | |||
620 | .quad quiet_ni_syscall /* tux */ | 620 | .quad quiet_ni_syscall /* tux */ |
621 | .quad quiet_ni_syscall /* security */ | 621 | .quad quiet_ni_syscall /* security */ |
622 | .quad sys_gettid | 622 | .quad sys_gettid |
623 | .quad sys_readahead /* 225 */ | 623 | .quad sys32_readahead /* 225 */ |
624 | .quad sys_setxattr | 624 | .quad sys_setxattr |
625 | .quad sys_lsetxattr | 625 | .quad sys_lsetxattr |
626 | .quad sys_fsetxattr | 626 | .quad sys_fsetxattr |
@@ -645,7 +645,7 @@ ia32_sys_call_table: | |||
645 | .quad compat_sys_io_getevents | 645 | .quad compat_sys_io_getevents |
646 | .quad compat_sys_io_submit | 646 | .quad compat_sys_io_submit |
647 | .quad sys_io_cancel | 647 | .quad sys_io_cancel |
648 | .quad sys_fadvise64 /* 250 */ | 648 | .quad sys32_fadvise64 /* 250 */ |
649 | .quad quiet_ni_syscall /* free_huge_pages */ | 649 | .quad quiet_ni_syscall /* free_huge_pages */ |
650 | .quad sys_exit_group | 650 | .quad sys_exit_group |
651 | .quad sys32_lookup_dcookie | 651 | .quad sys32_lookup_dcookie |
@@ -709,7 +709,7 @@ ia32_sys_call_table: | |||
709 | .quad compat_sys_set_robust_list | 709 | .quad compat_sys_set_robust_list |
710 | .quad compat_sys_get_robust_list | 710 | .quad compat_sys_get_robust_list |
711 | .quad sys_splice | 711 | .quad sys_splice |
712 | .quad sys_sync_file_range | 712 | .quad sys32_sync_file_range |
713 | .quad sys_tee /* 315 */ | 713 | .quad sys_tee /* 315 */ |
714 | .quad compat_sys_vmsplice | 714 | .quad compat_sys_vmsplice |
715 | .quad compat_sys_move_pages | 715 | .quad compat_sys_move_pages |
diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c index 200fdde18d96..99a78a3cce7c 100644 --- a/arch/x86_64/ia32/sys_ia32.c +++ b/arch/x86_64/ia32/sys_ia32.c | |||
@@ -860,3 +860,22 @@ long sys32_lookup_dcookie(u32 addr_low, u32 addr_high, | |||
860 | return sys_lookup_dcookie(((u64)addr_high << 32) | addr_low, buf, len); | 860 | return sys_lookup_dcookie(((u64)addr_high << 32) | addr_low, buf, len); |
861 | } | 861 | } |
862 | 862 | ||
863 | asmlinkage ssize_t sys32_readahead(int fd, unsigned off_lo, unsigned off_hi, size_t count) | ||
864 | { | ||
865 | return sys_readahead(fd, ((u64)off_hi << 32) | off_lo, count); | ||
866 | } | ||
867 | |||
868 | asmlinkage long sys32_sync_file_range(int fd, unsigned off_low, unsigned off_hi, | ||
869 | unsigned n_low, unsigned n_hi, int flags) | ||
870 | { | ||
871 | return sys_sync_file_range(fd, | ||
872 | ((u64)off_hi << 32) | off_low, | ||
873 | ((u64)n_hi << 32) | n_low, flags); | ||
874 | } | ||
875 | |||
876 | asmlinkage long sys32_fadvise64(int fd, unsigned offset_lo, unsigned offset_hi, size_t len, | ||
877 | int advice) | ||
878 | { | ||
879 | return sys_fadvise64_64(fd, ((u64)offset_hi << 32) | offset_lo, | ||
880 | len, advice); | ||
881 | } | ||