summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-09-25 21:37:28 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2017-10-11 13:41:41 -0400
commit6aa211e8ce6916d8a0df88b4fbc790e9c78f5d9d (patch)
treec610aa3b7c3a0b36a8577dfd1497cd033e79c79a /ipc
parent878e832ade6fc315e6ea59d95824bbb0430c6e8d (diff)
fix address space warnings in ipc/
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/msg.c4
-rw-r--r--ipc/sem.c4
-rw-r--r--ipc/shm.c4
-rw-r--r--ipc/syscall.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/ipc/msg.c b/ipc/msg.c
index 06be5a9adfa4..ebb7ea24ee28 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -590,13 +590,13 @@ static int copy_compat_msqid_from_user(struct msqid64_ds *out, void __user *buf,
590{ 590{
591 memset(out, 0, sizeof(*out)); 591 memset(out, 0, sizeof(*out));
592 if (version == IPC_64) { 592 if (version == IPC_64) {
593 struct compat_msqid64_ds *p = buf; 593 struct compat_msqid64_ds __user *p = buf;
594 if (get_compat_ipc64_perm(&out->msg_perm, &p->msg_perm)) 594 if (get_compat_ipc64_perm(&out->msg_perm, &p->msg_perm))
595 return -EFAULT; 595 return -EFAULT;
596 if (get_user(out->msg_qbytes, &p->msg_qbytes)) 596 if (get_user(out->msg_qbytes, &p->msg_qbytes))
597 return -EFAULT; 597 return -EFAULT;
598 } else { 598 } else {
599 struct compat_msqid_ds *p = buf; 599 struct compat_msqid_ds __user *p = buf;
600 if (get_compat_ipc_perm(&out->msg_perm, &p->msg_perm)) 600 if (get_compat_ipc_perm(&out->msg_perm, &p->msg_perm))
601 return -EFAULT; 601 return -EFAULT;
602 if (get_user(out->msg_qbytes, &p->msg_qbytes)) 602 if (get_user(out->msg_qbytes, &p->msg_qbytes))
diff --git a/ipc/sem.c b/ipc/sem.c
index f7385bce5fd3..6220e9616207 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -1636,10 +1636,10 @@ static int copy_compat_semid_from_user(struct semid64_ds *out, void __user *buf,
1636{ 1636{
1637 memset(out, 0, sizeof(*out)); 1637 memset(out, 0, sizeof(*out));
1638 if (version == IPC_64) { 1638 if (version == IPC_64) {
1639 struct compat_semid64_ds *p = buf; 1639 struct compat_semid64_ds __user *p = buf;
1640 return get_compat_ipc64_perm(&out->sem_perm, &p->sem_perm); 1640 return get_compat_ipc64_perm(&out->sem_perm, &p->sem_perm);
1641 } else { 1641 } else {
1642 struct compat_semid_ds *p = buf; 1642 struct compat_semid_ds __user *p = buf;
1643 return get_compat_ipc_perm(&out->sem_perm, &p->sem_perm); 1643 return get_compat_ipc_perm(&out->sem_perm, &p->sem_perm);
1644 } 1644 }
1645} 1645}
diff --git a/ipc/shm.c b/ipc/shm.c
index 1b3adfe3c60e..41706416a3c4 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -1193,10 +1193,10 @@ static int copy_compat_shmid_from_user(struct shmid64_ds *out, void __user *buf,
1193{ 1193{
1194 memset(out, 0, sizeof(*out)); 1194 memset(out, 0, sizeof(*out));
1195 if (version == IPC_64) { 1195 if (version == IPC_64) {
1196 struct compat_shmid64_ds *p = buf; 1196 struct compat_shmid64_ds __user *p = buf;
1197 return get_compat_ipc64_perm(&out->shm_perm, &p->shm_perm); 1197 return get_compat_ipc64_perm(&out->shm_perm, &p->shm_perm);
1198 } else { 1198 } else {
1199 struct compat_shmid_ds *p = buf; 1199 struct compat_shmid_ds __user *p = buf;
1200 return get_compat_ipc_perm(&out->shm_perm, &p->shm_perm); 1200 return get_compat_ipc_perm(&out->shm_perm, &p->shm_perm);
1201 } 1201 }
1202} 1202}
diff --git a/ipc/syscall.c b/ipc/syscall.c
index 667022746ca5..977bffd5a7f8 100644
--- a/ipc/syscall.c
+++ b/ipc/syscall.c
@@ -171,7 +171,7 @@ COMPAT_SYSCALL_DEFINE6(ipc, u32, call, int, first, int, second,
171 COMPAT_SHMLBA); 171 COMPAT_SHMLBA);
172 if (err < 0) 172 if (err < 0)
173 return err; 173 return err;
174 return put_user(raddr, (compat_ulong_t *)compat_ptr(third)); 174 return put_user(raddr, (compat_ulong_t __user *)compat_ptr(third));
175 } 175 }
176 case SHMDT: 176 case SHMDT:
177 return sys_shmdt(compat_ptr(ptr)); 177 return sys_shmdt(compat_ptr(ptr));