summaryrefslogtreecommitdiff
path: root/ipc/shm.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2017-07-09 10:38:28 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2017-07-15 20:46:47 -0400
commita78ee9ed2f828e1960f366bf7ab204e7f19924c7 (patch)
tree4404d3fe1a46a34c28028df0826dfa71ccf356bc /ipc/shm.c
parent9b1404c24a357332cb2a6df7c4337e943a4545fd (diff)
downloadlwn-a78ee9ed2f828e1960f366bf7ab204e7f19924c7.tar.gz
lwn-a78ee9ed2f828e1960f366bf7ab204e7f19924c7.zip
shmat(2): move compat to native
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'ipc/shm.c')
-rw-r--r--ipc/shm.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/ipc/shm.c b/ipc/shm.c
index 2e31545035a6..342024de3b9d 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -1439,6 +1439,25 @@ SYSCALL_DEFINE3(shmat, int, shmid, char __user *, shmaddr, int, shmflg)
return (long)ret;
}
+#ifdef CONFIG_COMPAT
+
+#ifndef COMPAT_SHMLBA
+#define COMPAT_SHMLBA SHMLBA
+#endif
+
+COMPAT_SYSCALL_DEFINE3(shmat, int, shmid, compat_uptr_t, shmaddr, int, shmflg)
+{
+ unsigned long ret;
+ long err;
+
+ err = do_shmat(shmid, compat_ptr(shmaddr), shmflg, &ret, COMPAT_SHMLBA);
+ if (err)
+ return err;
+ force_successful_syscall_return();
+ return (long)ret;
+}
+#endif
+
/*
* detach and kill segment if marked destroyed.
* The work is done in shm_close.