summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2018-03-20 19:33:48 +0100
committerDominik Brodowski <linux@dominikbrodowski.net>2018-04-02 20:15:42 +0200
commit05585e449572d7bdb798a87a732f86760c6b3c77 (patch)
tree8dcd23631e3face7b20d8c1f40f02b354b918d33
parente02af2ff654806c5dc93412fffd77d67d1125ccc (diff)
downloadlinux-05585e449572d7bdb798a87a732f86760c6b3c77.tar.bz2
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: Dominik Brodowski <linux@dominikbrodowski.net>
-rw-r--r--fs/select.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/fs/select.c b/fs/select.c
index b5df01c4587d..ba879c51288f 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -1265,9 +1265,9 @@ out_nofds:
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)
+static int do_compat_select(int n, compat_ulong_t __user *inp,
+ compat_ulong_t __user *outp, compat_ulong_t __user *exp,
+ struct compat_timeval __user *tvp)
{
struct timespec64 end_time, *to = NULL;
struct compat_timeval tv;
@@ -1290,6 +1290,13 @@ COMPAT_SYSCALL_DEFINE5(select, int, n, compat_ulong_t __user *, inp,
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 {
compat_ulong_t n;
compat_uptr_t inp;
@@ -1304,8 +1311,8 @@ COMPAT_SYSCALL_DEFINE1(old_select, struct compat_sel_arg_struct __user *, arg)
if (copy_from_user(&a, arg, sizeof(a)))
return -EFAULT;
- return compat_sys_select(a.n, compat_ptr(a.inp), compat_ptr(a.outp),
- compat_ptr(a.exp), compat_ptr(a.tvp));
+ return do_compat_select(a.n, compat_ptr(a.inp), compat_ptr(a.outp),
+ compat_ptr(a.exp), compat_ptr(a.tvp));
}
static long do_compat_pselect(int n, compat_ulong_t __user *inp,