Commit 05585e44 authored by Dominik Brodowski's avatar Dominik Brodowski

fs: add do_compat_select() helper; remove in-kernel call to compat syscall

Using the fs-internal do_compat_select() helper allows us to get rid of
the fs-internal call to the compat_sys_select() syscall.

This patch is part of a series which removes in-kernel calls to syscalls.
On this basis, the syscall entry path can be streamlined. For details, see
http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent e02af2ff
...@@ -1265,9 +1265,9 @@ static int compat_core_sys_select(int n, compat_ulong_t __user *inp, ...@@ -1265,9 +1265,9 @@ static int compat_core_sys_select(int n, compat_ulong_t __user *inp,
return ret; return ret;
} }
COMPAT_SYSCALL_DEFINE5(select, int, n, compat_ulong_t __user *, inp, static int do_compat_select(int n, compat_ulong_t __user *inp,
compat_ulong_t __user *, outp, compat_ulong_t __user *, exp, compat_ulong_t __user *outp, compat_ulong_t __user *exp,
struct compat_timeval __user *, tvp) struct compat_timeval __user *tvp)
{ {
struct timespec64 end_time, *to = NULL; struct timespec64 end_time, *to = NULL;
struct compat_timeval tv; struct compat_timeval tv;
...@@ -1290,6 +1290,13 @@ COMPAT_SYSCALL_DEFINE5(select, int, n, compat_ulong_t __user *, inp, ...@@ -1290,6 +1290,13 @@ COMPAT_SYSCALL_DEFINE5(select, int, n, compat_ulong_t __user *, inp,
return ret; return ret;
} }
COMPAT_SYSCALL_DEFINE5(select, int, n, compat_ulong_t __user *, inp,
compat_ulong_t __user *, outp, compat_ulong_t __user *, exp,
struct compat_timeval __user *, tvp)
{
return do_compat_select(n, inp, outp, exp, tvp);
}
struct compat_sel_arg_struct { struct compat_sel_arg_struct {
compat_ulong_t n; compat_ulong_t n;
compat_uptr_t inp; compat_uptr_t inp;
...@@ -1304,7 +1311,7 @@ COMPAT_SYSCALL_DEFINE1(old_select, struct compat_sel_arg_struct __user *, arg) ...@@ -1304,7 +1311,7 @@ COMPAT_SYSCALL_DEFINE1(old_select, struct compat_sel_arg_struct __user *, arg)
if (copy_from_user(&a, arg, sizeof(a))) if (copy_from_user(&a, arg, sizeof(a)))
return -EFAULT; return -EFAULT;
return compat_sys_select(a.n, compat_ptr(a.inp), compat_ptr(a.outp), return do_compat_select(a.n, compat_ptr(a.inp), compat_ptr(a.outp),
compat_ptr(a.exp), compat_ptr(a.tvp)); compat_ptr(a.exp), compat_ptr(a.tvp));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment