diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2018-03-20 16:25:57 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2018-04-02 14:15:27 -0400 |
commit | 078faac9e8b6c8124bc012bbf97cca59caf6d4ea (patch) | |
tree | 565af5f9110fd70f649f41af3b296077fd3aa646 /ipc/syscall.c | |
parent | e340db56483b6e10bd5e5f281071876808801a41 (diff) |
ipc: add msgrcv syscall/compat_syscall wrappers
Provide ksys_msgrcv() and compat_ksys_msgrcv() wrappers to avoid in-kernel
calls to these syscalls. The ksys_ prefix denotes that these functions are
meant as a drop-in replacement for the syscalls. In particular, they use
the same calling convention as sys_msgrcv() and compat_sys_msgrcv().
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>
Diffstat (limited to 'ipc/syscall.c')
-rw-r--r-- | ipc/syscall.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ipc/syscall.c b/ipc/syscall.c index aa29b0802e26..0228c7afd882 100644 --- a/ipc/syscall.c +++ b/ipc/syscall.c | |||
@@ -59,11 +59,11 @@ SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, unsigned long, second, | |||
59 | (struct ipc_kludge __user *) ptr, | 59 | (struct ipc_kludge __user *) ptr, |
60 | sizeof(tmp))) | 60 | sizeof(tmp))) |
61 | return -EFAULT; | 61 | return -EFAULT; |
62 | return sys_msgrcv(first, tmp.msgp, second, | 62 | return ksys_msgrcv(first, tmp.msgp, second, |
63 | tmp.msgtyp, third); | 63 | tmp.msgtyp, third); |
64 | } | 64 | } |
65 | default: | 65 | default: |
66 | return sys_msgrcv(first, | 66 | return ksys_msgrcv(first, |
67 | (struct msgbuf __user *) ptr, | 67 | (struct msgbuf __user *) ptr, |
68 | second, fifth, third); | 68 | second, fifth, third); |
69 | } | 69 | } |
@@ -156,10 +156,10 @@ COMPAT_SYSCALL_DEFINE6(ipc, u32, call, int, first, int, second, | |||
156 | return -EINVAL; | 156 | return -EINVAL; |
157 | if (copy_from_user(&ipck, uptr, sizeof(ipck))) | 157 | if (copy_from_user(&ipck, uptr, sizeof(ipck))) |
158 | return -EFAULT; | 158 | return -EFAULT; |
159 | return compat_sys_msgrcv(first, ipck.msgp, second, | 159 | return compat_ksys_msgrcv(first, ipck.msgp, second, |
160 | ipck.msgtyp, third); | 160 | ipck.msgtyp, third); |
161 | } | 161 | } |
162 | return compat_sys_msgrcv(first, ptr, second, fifth, third); | 162 | return compat_ksys_msgrcv(first, ptr, second, fifth, third); |
163 | } | 163 | } |
164 | case MSGGET: | 164 | case MSGGET: |
165 | return ksys_msgget(first, second); | 165 | return ksys_msgget(first, second); |