Commit 642e7fd2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'syscalls-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux

Pull removal of in-kernel calls to syscalls from Dominik Brodowski:
 "System calls are interaction points between userspace and the kernel.
  Therefore, system call functions such as sys_xyzzy() or
  compat_sys_xyzzy() should only be called from userspace via the
  syscall table, but not from elsewhere in the kernel.

  At least on 64-bit x86, it will likely be a hard requirement from
  v4.17 onwards to not call system call functions in the kernel: It is
  better to use use a different calling convention for system calls
  there, where struct pt_regs is decoded on-the-fly in a syscall wrapper
  which then hands processing over to the actual syscall function. This
  means that only those parameters which are actually needed for a
  specific syscall are passed on during syscall entry, instead of
  filling in six CPU registers with random user space content all the
  time (which may cause serious trouble down the call chain). Those
  x86-specific patches will be pushed through the x86 tree in the near
  future.

  Moreover, rules on how data may be accessed may differ between kernel
  data and user data. This is another reason why calling sys_xyzzy() is
  generally a bad idea, and -- at most -- acceptable in arch-specific
  code.

  This patchset removes all in-kernel calls to syscall functions in the
  kernel with the exception of arch/. On top of this, it cleans up the
  three places where many syscalls are referenced or prototyped, namely
  kernel/sys_ni.c, include/linux/syscalls.h and include/linux/compat.h"

* 'syscalls-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux: (109 commits)
  bpf: whitelist all syscalls for error injection
  kernel/sys_ni: remove {sys_,sys_compat} from cond_syscall definitions
  kernel/sys_ni: sort cond_syscall() entries
  syscalls/x86: auto-create compat_sys_*() prototypes
  syscalls: sort syscall prototypes in include/linux/compat.h
  net: remove compat_sys_*() prototypes from net/compat.h
  syscalls: sort syscall prototypes in include/linux/syscalls.h
  kexec: move sys_kexec_load() prototype to syscalls.h
  x86/sigreturn: use SYSCALL_DEFINE0
  x86: fix sys_sigreturn() return type to be long, not unsigned long
  x86/ioport: add ksys_ioperm() helper; remove in-kernel calls to sys_ioperm()
  mm: add ksys_readahead() helper; remove in-kernel calls to sys_readahead()
  mm: add ksys_mmap_pgoff() helper; remove in-kernel calls to sys_mmap_pgoff()
  mm: add ksys_fadvise64_64() helper; remove in-kernel call to sys_fadvise64_64()
  fs: add ksys_fallocate() wrapper; remove in-kernel calls to sys_fallocate()
  fs: add ksys_p{read,write}64() helpers; remove in-kernel calls to syscalls
  fs: add ksys_truncate() wrapper; remove in-kernel calls to sys_truncate()
  fs: add ksys_sync_file_range helper(); remove in-kernel calls to syscall
  kernel: add ksys_setsid() helper; remove in-kernel call to sys_setsid()
  kernel: add ksys_unshare() helper; remove in-kernel calls to sys_unshare()
  ...
parents 21035965 c9a21195
...@@ -222,7 +222,7 @@ your new syscall number may get adjusted to resolve conflicts. ...@@ -222,7 +222,7 @@ your new syscall number may get adjusted to resolve conflicts.
The file ``kernel/sys_ni.c`` provides a fallback stub implementation of each The file ``kernel/sys_ni.c`` provides a fallback stub implementation of each
system call, returning ``-ENOSYS``. Add your new system call here too:: system call, returning ``-ENOSYS``. Add your new system call here too::
cond_syscall(sys_xyzzy); COND_SYSCALL(xyzzy);
Your new kernel functionality, and the system call that controls it, should Your new kernel functionality, and the system call that controls it, should
normally be optional, so add a ``CONFIG`` option (typically to normally be optional, so add a ``CONFIG`` option (typically to
...@@ -487,6 +487,38 @@ patchset, for the convenience of reviewers. ...@@ -487,6 +487,38 @@ patchset, for the convenience of reviewers.
The man page should be cc'ed to linux-man@vger.kernel.org The man page should be cc'ed to linux-man@vger.kernel.org
For more details, see https://www.kernel.org/doc/man-pages/patches.html For more details, see https://www.kernel.org/doc/man-pages/patches.html
Do not call System Calls in the Kernel
--------------------------------------
System calls are, as stated above, interaction points between userspace and
the kernel. Therefore, system call functions such as ``sys_xyzzy()`` or
``compat_sys_xyzzy()`` should only be called from userspace via the syscall
table, but not from elsewhere in the kernel. If the syscall functionality is
useful to be used within the kernel, needs to be shared between an old and a
new syscall, or needs to be shared between a syscall and its compatibility
variant, it should be implemented by means of a "helper" function (such as
``kern_xyzzy()``). This kernel function may then be called within the
syscall stub (``sys_xyzzy()``), the compatibility syscall stub
(``compat_sys_xyzzy()``), and/or other kernel code.
At least on 64-bit x86, it will be a hard requirement from v4.17 onwards to not
call system call functions in the kernel. It uses a different calling
convention for system calls where ``struct pt_regs`` is decoded on-the-fly in a
syscall wrapper which then hands processing over to the actual syscall function.
This means that only those parameters which are actually needed for a specific
syscall are passed on during syscall entry, instead of filling in six CPU
registers with random user space content all the time (which may cause serious
trouble down the call chain).
Moreover, rules on how data may be accessed may differ between kernel data and
user data. This is another reason why calling ``sys_xyzzy()`` is generally a
bad idea.
Exceptions to this rule are only allowed in architecture-specific overrides,
architecture-specific compatibility wrappers, or other code in arch/.
References and Sources References and Sources
---------------------- ----------------------
......
...@@ -189,7 +189,7 @@ SYSCALL_DEFINE6(osf_mmap, unsigned long, addr, unsigned long, len, ...@@ -189,7 +189,7 @@ SYSCALL_DEFINE6(osf_mmap, unsigned long, addr, unsigned long, len,
goto out; goto out;
if (off & ~PAGE_MASK) if (off & ~PAGE_MASK)
goto out; goto out;
ret = sys_mmap_pgoff(addr, len, prot, flags, fd, off >> PAGE_SHIFT); ret = ksys_mmap_pgoff(addr, len, prot, flags, fd, off >> PAGE_SHIFT);
out: out:
return ret; return ret;
} }
......
...@@ -35,5 +35,5 @@ ...@@ -35,5 +35,5 @@
asmlinkage long sys_arm_fadvise64_64(int fd, int advice, asmlinkage long sys_arm_fadvise64_64(int fd, int advice,
loff_t offset, loff_t len) loff_t offset, loff_t len)
{ {
return sys_fadvise64_64(fd, offset, len, advice); return ksys_fadvise64_64(fd, offset, len, advice);
} }
...@@ -34,7 +34,7 @@ asmlinkage long sys_mmap(unsigned long addr, unsigned long len, ...@@ -34,7 +34,7 @@ asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
if (offset_in_page(off) != 0) if (offset_in_page(off) != 0)
return -EINVAL; return -EINVAL;
return sys_mmap_pgoff(addr, len, prot, flags, fd, off >> PAGE_SHIFT); return ksys_mmap_pgoff(addr, len, prot, flags, fd, off >> PAGE_SHIFT);
} }
SYSCALL_DEFINE1(arm64_personality, unsigned int, personality) SYSCALL_DEFINE1(arm64_personality, unsigned int, personality)
......
...@@ -139,7 +139,7 @@ int ia64_mmap_check(unsigned long addr, unsigned long len, ...@@ -139,7 +139,7 @@ int ia64_mmap_check(unsigned long addr, unsigned long len,
asmlinkage unsigned long asmlinkage unsigned long
sys_mmap2 (unsigned long addr, unsigned long len, int prot, int flags, int fd, long pgoff) sys_mmap2 (unsigned long addr, unsigned long len, int prot, int flags, int fd, long pgoff)
{ {
addr = sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff); addr = ksys_mmap_pgoff(addr, len, prot, flags, fd, pgoff);
if (!IS_ERR((void *) addr)) if (!IS_ERR((void *) addr))
force_successful_syscall_return(); force_successful_syscall_return();
return addr; return addr;
...@@ -151,7 +151,7 @@ sys_mmap (unsigned long addr, unsigned long len, int prot, int flags, int fd, lo ...@@ -151,7 +151,7 @@ sys_mmap (unsigned long addr, unsigned long len, int prot, int flags, int fd, lo
if (offset_in_page(off) != 0) if (offset_in_page(off) != 0)
return -EINVAL; return -EINVAL;
addr = sys_mmap_pgoff(addr, len, prot, flags, fd, off >> PAGE_SHIFT); addr = ksys_mmap_pgoff(addr, len, prot, flags, fd, off >> PAGE_SHIFT);
if (!IS_ERR((void *) addr)) if (!IS_ERR((void *) addr))
force_successful_syscall_return(); force_successful_syscall_return();
return addr; return addr;
......
...@@ -46,7 +46,7 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, ...@@ -46,7 +46,7 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
* so we need to shift the argument down by 1; m68k mmap64(3) * so we need to shift the argument down by 1; m68k mmap64(3)
* (in libc) expects the last argument of mmap2 in 4Kb units. * (in libc) expects the last argument of mmap2 in 4Kb units.
*/ */
return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff); return ksys_mmap_pgoff(addr, len, prot, flags, fd, pgoff);
} }
/* Convert virtual (user) address VADDR to physical address PADDR */ /* Convert virtual (user) address VADDR to physical address PADDR */
......
...@@ -40,7 +40,7 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len, ...@@ -40,7 +40,7 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len,
if (pgoff & ~PAGE_MASK) if (pgoff & ~PAGE_MASK)
return -EINVAL; return -EINVAL;
return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff >> PAGE_SHIFT); return ksys_mmap_pgoff(addr, len, prot, flags, fd, pgoff >> PAGE_SHIFT);
} }
SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
...@@ -50,6 +50,6 @@ SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, ...@@ -50,6 +50,6 @@ SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
if (pgoff & (~PAGE_MASK >> 12)) if (pgoff & (~PAGE_MASK >> 12))
return -EINVAL; return -EINVAL;
return sys_mmap_pgoff(addr, len, prot, flags, fd, return ksys_mmap_pgoff(addr, len, prot, flags, fd,
pgoff >> (PAGE_SHIFT - 12)); pgoff >> (PAGE_SHIFT - 12));
} }
...@@ -67,8 +67,8 @@ SYSCALL_DEFINE6(32_mmap2, unsigned long, addr, unsigned long, len, ...@@ -67,8 +67,8 @@ SYSCALL_DEFINE6(32_mmap2, unsigned long, addr, unsigned long, len,
{ {
if (pgoff & (~PAGE_MASK >> 12)) if (pgoff & (~PAGE_MASK >> 12))
return -EINVAL; return -EINVAL;
return sys_mmap_pgoff(addr, len, prot, flags, fd, return ksys_mmap_pgoff(addr, len, prot, flags, fd,
pgoff >> (PAGE_SHIFT-12)); pgoff >> (PAGE_SHIFT-12));
} }
#define RLIM_INFINITY32 0x7fffffff #define RLIM_INFINITY32 0x7fffffff
...@@ -82,13 +82,13 @@ struct rlimit32 { ...@@ -82,13 +82,13 @@ struct rlimit32 {
SYSCALL_DEFINE4(32_truncate64, const char __user *, path, SYSCALL_DEFINE4(32_truncate64, const char __user *, path,
unsigned long, __dummy, unsigned long, a2, unsigned long, a3) unsigned long, __dummy, unsigned long, a2, unsigned long, a3)
{ {
return sys_truncate(path, merge_64(a2, a3)); return ksys_truncate(path, merge_64(a2, a3));
} }
SYSCALL_DEFINE4(32_ftruncate64, unsigned long, fd, unsigned long, __dummy, SYSCALL_DEFINE4(32_ftruncate64, unsigned long, fd, unsigned long, __dummy,
unsigned long, a2, unsigned long, a3) unsigned long, a2, unsigned long, a3)
{ {
return sys_ftruncate(fd, merge_64(a2, a3)); return ksys_ftruncate(fd, merge_64(a2, a3));
} }
SYSCALL_DEFINE5(32_llseek, unsigned int, fd, unsigned int, offset_high, SYSCALL_DEFINE5(32_llseek, unsigned int, fd, unsigned int, offset_high,
...@@ -105,13 +105,13 @@ SYSCALL_DEFINE5(32_llseek, unsigned int, fd, unsigned int, offset_high, ...@@ -105,13 +105,13 @@ SYSCALL_DEFINE5(32_llseek, unsigned int, fd, unsigned int, offset_high,
SYSCALL_DEFINE6(32_pread, unsigned long, fd, char __user *, buf, size_t, count, SYSCALL_DEFINE6(32_pread, unsigned long, fd, char __user *, buf, size_t, count,
unsigned long, unused, unsigned long, a4, unsigned long, a5) unsigned long, unused, unsigned long, a4, unsigned long, a5)
{ {
return sys_pread64(fd, buf, count, merge_64(a4, a5)); return ksys_pread64(fd, buf, count, merge_64(a4, a5));
} }
SYSCALL_DEFINE6(32_pwrite, unsigned int, fd, const char __user *, buf, SYSCALL_DEFINE6(32_pwrite, unsigned int, fd, const char __user *, buf,
size_t, count, u32, unused, u64, a4, u64, a5) size_t, count, u32, unused, u64, a4, u64, a5)
{ {
return sys_pwrite64(fd, buf, count, merge_64(a4, a5)); return ksys_pwrite64(fd, buf, count, merge_64(a4, a5));
} }
SYSCALL_DEFINE1(32_personality, unsigned long, personality) SYSCALL_DEFINE1(32_personality, unsigned long, personality)
...@@ -131,7 +131,7 @@ SYSCALL_DEFINE1(32_personality, unsigned long, personality) ...@@ -131,7 +131,7 @@ SYSCALL_DEFINE1(32_personality, unsigned long, personality)
asmlinkage ssize_t sys32_readahead(int fd, u32 pad0, u64 a2, u64 a3, asmlinkage ssize_t sys32_readahead(int fd, u32 pad0, u64 a2, u64 a3,
size_t count) size_t count)
{ {
return sys_readahead(fd, merge_64(a2, a3), count); return ksys_readahead(fd, merge_64(a2, a3), count);
} }
asmlinkage long sys32_sync_file_range(int fd, int __pad, asmlinkage long sys32_sync_file_range(int fd, int __pad,
...@@ -139,7 +139,7 @@ asmlinkage long sys32_sync_file_range(int fd, int __pad, ...@@ -139,7 +139,7 @@ asmlinkage long sys32_sync_file_range(int fd, int __pad,
unsigned long a4, unsigned long a5, unsigned long a4, unsigned long a5,
int flags) int flags)
{ {
return sys_sync_file_range(fd, return ksys_sync_file_range(fd,
merge_64(a2, a3), merge_64(a4, a5), merge_64(a2, a3), merge_64(a4, a5),
flags); flags);
} }
...@@ -149,7 +149,7 @@ asmlinkage long sys32_fadvise64_64(int fd, int __pad, ...@@ -149,7 +149,7 @@ asmlinkage long sys32_fadvise64_64(int fd, int __pad,
unsigned long a4, unsigned long a5, unsigned long a4, unsigned long a5,
int flags) int flags)
{ {
return sys_fadvise64_64(fd, return ksys_fadvise64_64(fd,
merge_64(a2, a3), merge_64(a4, a5), merge_64(a2, a3), merge_64(a4, a5),
flags); flags);
} }
...@@ -157,6 +157,6 @@ asmlinkage long sys32_fadvise64_64(int fd, int __pad, ...@@ -157,6 +157,6 @@ asmlinkage long sys32_fadvise64_64(int fd, int __pad,
asmlinkage long sys32_fallocate(int fd, int mode, unsigned offset_a2, asmlinkage long sys32_fallocate(int fd, int mode, unsigned offset_a2,
unsigned offset_a3, unsigned len_a4, unsigned len_a5) unsigned offset_a3, unsigned len_a4, unsigned len_a5)
{ {
return sys_fallocate(fd, mode, merge_64(offset_a2, offset_a3), return ksys_fallocate(fd, mode, merge_64(offset_a2, offset_a3),
merge_64(len_a4, len_a5)); merge_64(len_a4, len_a5));
} }
...@@ -63,7 +63,8 @@ SYSCALL_DEFINE6(mips_mmap, unsigned long, addr, unsigned long, len, ...@@ -63,7 +63,8 @@ SYSCALL_DEFINE6(mips_mmap, unsigned long, addr, unsigned long, len,
{ {
if (offset & ~PAGE_MASK) if (offset & ~PAGE_MASK)
return -EINVAL; return -EINVAL;
return sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); return ksys_mmap_pgoff(addr, len, prot, flags, fd,
offset >> PAGE_SHIFT);
} }
SYSCALL_DEFINE6(mips_mmap2, unsigned long, addr, unsigned long, len, SYSCALL_DEFINE6(mips_mmap2, unsigned long, addr, unsigned long, len,
...@@ -73,7 +74,8 @@ SYSCALL_DEFINE6(mips_mmap2, unsigned long, addr, unsigned long, len, ...@@ -73,7 +74,8 @@ SYSCALL_DEFINE6(mips_mmap2, unsigned long, addr, unsigned long, len,
if (pgoff & (~PAGE_MASK >> 12)) if (pgoff & (~PAGE_MASK >> 12))
return -EINVAL; return -EINVAL;
return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff >> (PAGE_SHIFT-12)); return ksys_mmap_pgoff(addr, len, prot, flags, fd,
pgoff >> (PAGE_SHIFT - 12));
} }
save_static_function(sys_fork); save_static_function(sys_fork);
......
...@@ -270,8 +270,8 @@ asmlinkage unsigned long sys_mmap2(unsigned long addr, unsigned long len, ...@@ -270,8 +270,8 @@ asmlinkage unsigned long sys_mmap2(unsigned long addr, unsigned long len,
{ {
/* Make sure the shift for mmap2 is constant (12), no matter what PAGE_SIZE /* Make sure the shift for mmap2 is constant (12), no matter what PAGE_SIZE
we have. */ we have. */
return sys_mmap_pgoff(addr, len, prot, flags, fd, return ksys_mmap_pgoff(addr, len, prot, flags, fd,
pgoff >> (PAGE_SHIFT - 12)); pgoff >> (PAGE_SHIFT - 12));
} }
asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len, asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len,
...@@ -279,7 +279,7 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len, ...@@ -279,7 +279,7 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len,
unsigned long offset) unsigned long offset)
{ {
if (!(offset & ~PAGE_MASK)) { if (!(offset & ~PAGE_MASK)) {
return sys_mmap_pgoff(addr, len, prot, flags, fd, return ksys_mmap_pgoff(addr, len, prot, flags, fd,
offset >> PAGE_SHIFT); offset >> PAGE_SHIFT);
} else { } else {
return -EINVAL; return -EINVAL;
...@@ -292,24 +292,24 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len, ...@@ -292,24 +292,24 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len,
asmlinkage long parisc_truncate64(const char __user * path, asmlinkage long parisc_truncate64(const char __user * path,
unsigned int high, unsigned int low) unsigned int high, unsigned int low)
{ {
return sys_truncate(path, (long)high << 32 | low); return ksys_truncate(path, (long)high << 32 | low);
} }
asmlinkage long parisc_ftruncate64(unsigned int fd, asmlinkage long parisc_ftruncate64(unsigned int fd,
unsigned int high, unsigned int low) unsigned int high, unsigned int low)
{ {
return sys_ftruncate(fd, (long)high << 32 | low); return ksys_ftruncate(fd, (long)high << 32 | low);
} }
/* stubs for the benefit of the syscall_table since truncate64 and truncate /* stubs for the benefit of the syscall_table since truncate64 and truncate
* are identical on LP64 */ * are identical on LP64 */
asmlinkage long sys_truncate64(const char __user * path, unsigned long length) asmlinkage long sys_truncate64(const char __user * path, unsigned long length)
{ {
return sys_truncate(path, length); return ksys_truncate(path, length);
} }
asmlinkage long sys_ftruncate64(unsigned int fd, unsigned long length) asmlinkage long sys_ftruncate64(unsigned int fd, unsigned long length)
{ {
return sys_ftruncate(fd, length); return ksys_ftruncate(fd, length);
} }
asmlinkage long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg) asmlinkage long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg)
{ {
...@@ -320,7 +320,7 @@ asmlinkage long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg ...@@ -320,7 +320,7 @@ asmlinkage long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg
asmlinkage long parisc_truncate64(const char __user * path, asmlinkage long parisc_truncate64(const char __user * path,
unsigned int high, unsigned int low) unsigned int high, unsigned int low)
{ {
return sys_truncate64(path, (loff_t)high << 32 | low); return ksys_truncate(path, (loff_t)high << 32 | low);
} }
asmlinkage long parisc_ftruncate64(unsigned int fd, asmlinkage long parisc_ftruncate64(unsigned int fd,
...@@ -333,26 +333,26 @@ asmlinkage long parisc_ftruncate64(unsigned int fd, ...@@ -333,26 +333,26 @@ asmlinkage long parisc_ftruncate64(unsigned int fd,
asmlinkage ssize_t parisc_pread64(unsigned int fd, char __user *buf, size_t count, asmlinkage ssize_t parisc_pread64(unsigned int fd, char __user *buf, size_t count,
unsigned int high, unsigned int low) unsigned int high, unsigned int low)
{ {
return sys_pread64(fd, buf, count, (loff_t)high << 32 | low); return ksys_pread64(fd, buf, count, (loff_t)high << 32 | low);
} }
asmlinkage ssize_t parisc_pwrite64(unsigned int fd, const char __user *buf, asmlinkage ssize_t parisc_pwrite64(unsigned int fd, const char __user *buf,
size_t count, unsigned int high, unsigned int low) size_t count, unsigned int high, unsigned int low)
{ {
return sys_pwrite64(fd, buf, count, (loff_t)high << 32 | low); return ksys_pwrite64(fd, buf, count, (loff_t)high << 32 | low);
} }
asmlinkage ssize_t parisc_readahead(int fd, unsigned int high, unsigned int low, asmlinkage ssize_t parisc_readahead(int fd, unsigned int high, unsigned int low,
size_t count) size_t count)
{ {
return sys_readahead(fd, (loff_t)high << 32 | low, count); return ksys_readahead(fd, (loff_t)high << 32 | low, count);
} }
asmlinkage long parisc_fadvise64_64(int fd, asmlinkage long parisc_fadvise64_64(int fd,
unsigned int high_off, unsigned int low_off, unsigned int high_off, unsigned int low_off,
unsigned int high_len, unsigned int low_len, int advice) unsigned int high_len, unsigned int low_len, int advice)
{ {
return sys_fadvise64_64(fd, (loff_t)high_off << 32 | low_off, return ksys_fadvise64_64(fd, (loff_t)high_off << 32 | low_off,
(loff_t)high_len << 32 | low_len, advice); (loff_t)high_len << 32 | low_len, advice);
} }
...@@ -360,15 +360,15 @@ asmlinkage long parisc_sync_file_range(int fd, ...@@ -360,15 +360,15 @@ asmlinkage long parisc_sync_file_range(int fd,
u32 hi_off, u32 lo_off, u32 hi_nbytes, u32 lo_nbytes, u32 hi_off, u32 lo_off, u32 hi_nbytes, u32 lo_nbytes,
unsigned int flags) unsigned int flags)
{ {
return sys_sync_file_range(fd, (loff_t)hi_off << 32 | lo_off, return ksys_sync_file_range(fd, (loff_t)hi_off << 32 | lo_off,
(loff_t)hi_nbytes << 32 | lo_nbytes, flags); (loff_t)hi_nbytes << 32 | lo_nbytes, flags);
} }
asmlinkage long parisc_fallocate(int fd, int mode, u32 offhi, u32 offlo, asmlinkage long parisc_fallocate(int fd, int mode, u32 offhi, u32 offlo,
u32 lenhi, u32 lenlo) u32 lenhi, u32 lenlo)
{ {
return sys_fallocate(fd, mode, ((u64)offhi << 32) | offlo, return ksys_fallocate(fd, mode, ((u64)offhi << 32) | offlo,
((u64)lenhi << 32) | lenlo); ((u64)lenhi << 32) | lenlo);
} }
long parisc_personality(unsigned long personality) long parisc_personality(unsigned long personality)
......
...@@ -77,44 +77,44 @@ unsigned long compat_sys_mmap2(unsigned long addr, size_t len, ...@@ -77,44 +77,44 @@ unsigned long compat_sys_mmap2(unsigned long addr, size_t len,
compat_ssize_t compat_sys_pread64(unsigned int fd, char __user *ubuf, compat_size_t count, compat_ssize_t compat_sys_pread64(unsigned int fd, char __user *ubuf, compat_size_t count,
u32 reg6, u32 poshi, u32 poslo) u32 reg6, u32 poshi, u32 poslo)
{ {
return sys_pread64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo); return ksys_pread64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo);
} }
compat_ssize_t compat_sys_pwrite64(unsigned int fd, const char __user *ubuf, compat_size_t count, compat_ssize_t compat_sys_pwrite64(unsigned int fd, const char __user *ubuf, compat_size_t count,
u32 reg6, u32 poshi, u32 poslo) u32 reg6, u32 poshi, u32 poslo)
{ {
return sys_pwrite64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo); return ksys_pwrite64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo);
} }
compat_ssize_t compat_sys_readahead(int fd, u32 r4, u32 offhi, u32 offlo, u32 count) compat_ssize_t compat_sys_readahead(int fd, u32 r4, u32 offhi, u32 offlo, u32 count)
{ {
return sys_readahead(fd, ((loff_t)offhi << 32) | offlo, count); return ksys_readahead(fd, ((loff_t)offhi << 32) | offlo, count);
} }
asmlinkage int compat_sys_truncate64(const char __user * path, u32 reg4, asmlinkage int compat_sys_truncate64(const char __user * path, u32 reg4,
unsigned long high, unsigned long low) unsigned long high, unsigned long low)
{ {
return sys_truncate(path, (high << 32) | low); return ksys_truncate(path, (high << 32) | low);
} }
asmlinkage long compat_sys_fallocate(int fd, int mode, u32 offhi, u32 offlo, asmlinkage long compat_sys_fallocate(int fd, int mode, u32 offhi, u32 offlo,
u32 lenhi, u32 lenlo) u32 lenhi, u32 lenlo)
{ {
return sys_fallocate(fd, mode, ((loff_t)offhi << 32) | offlo, return ksys_fallocate(fd, mode, ((loff_t)offhi << 32) | offlo,
((loff_t)lenhi << 32) | lenlo); ((loff_t)lenhi << 32) | lenlo);
} }
asmlinkage int compat_sys_ftruncate64(unsigned int fd, u32 reg4, unsigned long high, asmlinkage int compat_sys_ftruncate64(unsigned int fd, u32 reg4, unsigned long high,
unsigned long low) unsigned long low)
{ {
return sys_ftruncate(fd, (high << 32) | low); return ksys_ftruncate(fd, (high << 32) | low);
} }
long ppc32_fadvise64(int fd, u32 unused, u32 offset_high, u32 offset_low, long ppc32_fadvise64(int fd, u32 unused, u32 offset_high, u32 offset_low,
size_t len, int advice) size_t len, int advice)
{ {
return sys_fadvise64(fd, (u64)offset_high << 32 | offset_low, len, return ksys_fadvise64_64(fd, (u64)offset_high << 32 | offset_low, len,
advice); advice);
} }
asmlinkage long compat_sys_sync_file_range2(int fd, unsigned int flags, asmlinkage long compat_sys_sync_file_range2(int fd, unsigned int flags,
...@@ -124,5 +124,5 @@ asmlinkage long compat_sys_sync_file_range2(int fd, unsigned int flags, ...@@ -124,5 +124,5 @@ asmlinkage long compat_sys_sync_file_range2(int fd, unsigned int flags,
loff_t offset = ((loff_t)offset_hi << 32) | offset_lo; loff_t offset = ((loff_t)offset_hi << 32) | offset_lo;
loff_t nbytes = ((loff_t)nbytes_hi << 32) | nbytes_lo; loff_t nbytes = ((loff_t)nbytes_hi << 32) | nbytes_lo;
return sys_sync_file_range(fd, offset, nbytes, flags); return ksys_sync_file_range(fd, offset, nbytes, flags);
} }
...@@ -57,7 +57,7 @@ static inline long do_mmap2(unsigned long addr, size_t len, ...@@ -57,7 +57,7 @@ static inline long do_mmap2(unsigned long addr, size_t len,
off >>= shift; off >>= shift;
} }