summaryrefslogtreecommitdiffstats
path: root/kernel/compat.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2017-05-26 22:04:29 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2017-05-27 15:38:06 -0400
commit613763a1f056211522bac77ff39f25706e678fdd (patch)
tree8c93f1836574bfad7be7bedab670defd5b7651b0 /kernel/compat.c
parent123dbfe088cb4f610c2a4c2da2d1a1f376c8886b (diff)
downloadlinux-stable-613763a1f056211522bac77ff39f25706e678fdd.tar.gz
linux-stable-613763a1f056211522bac77ff39f25706e678fdd.tar.bz2
linux-stable-613763a1f056211522bac77ff39f25706e678fdd.zip
take compat_sys_old_getrlimit() to native syscall
... and sanitize the ifdefs in there Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel/compat.c')
-rw-r--r--kernel/compat.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/kernel/compat.c b/kernel/compat.c
index 933bcb31ae10..860f674fa556 100644
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -468,35 +468,6 @@ COMPAT_SYSCALL_DEFINE2(setrlimit, unsigned int, resource,
return do_prlimit(current, resource, &r, NULL);
}
-#ifdef COMPAT_RLIM_OLD_INFINITY
-
-COMPAT_SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource,
- struct compat_rlimit __user *, rlim)
-{
- struct rlimit r;
- int ret;
- mm_segment_t old_fs = get_fs();
-
- set_fs(KERNEL_DS);
- ret = sys_old_getrlimit(resource, (struct rlimit __user *)&r);
- set_fs(old_fs);
-
- if (!ret) {
- if (r.rlim_cur > COMPAT_RLIM_OLD_INFINITY)
- r.rlim_cur = COMPAT_RLIM_INFINITY;
- if (r.rlim_max > COMPAT_RLIM_OLD_INFINITY)
- r.rlim_max = COMPAT_RLIM_INFINITY;
-
- if (!access_ok(VERIFY_WRITE, rlim, sizeof(*rlim)) ||
- __put_user(r.rlim_cur, &rlim->rlim_cur) ||
- __put_user(r.rlim_max, &rlim->rlim_max))
- return -EFAULT;
- }
- return ret;
-}
-
-#endif
-
COMPAT_SYSCALL_DEFINE2(getrlimit, unsigned int, resource,
struct compat_rlimit __user *, rlim)
{