Subject: [PATCH] Pspace support for syv ipc From: Eric W. Biederman Date: 1129745490 -0600 --- ipc/msg.c | 9 +++++---- ipc/sem.c | 3 ++- ipc/shm.c | 9 +++++---- 3 files changed, 12 insertions(+), 9 deletions(-) f26fbbff7bc13a6baea55abc6532b65734e62d85 diff --git a/ipc/msg.c b/ipc/msg.c index d035bd2..acfa2bd 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include "util.h" @@ -416,8 +417,8 @@ asmlinkage long sys_msgctl (int msqid, i tbuf.msg_cbytes = msq->q_cbytes; tbuf.msg_qnum = msq->q_qnum; tbuf.msg_qbytes = msq->q_qbytes; - tbuf.msg_lspid = msq->q_lspid; - tbuf.msg_lrpid = msq->q_lrpid; + tbuf.msg_lspid = pid_to_user(msq->q_lspid); + tbuf.msg_lrpid = pid_to_user(msq->q_lrpid); msg_unlock(msq); if (copy_msqid_to_user(buf, &tbuf, version)) return -EFAULT; @@ -821,8 +822,8 @@ static int sysvipc_msg_proc_show(struct msq->q_perm.mode, msq->q_cbytes, msq->q_qnum, - msq->q_lspid, - msq->q_lrpid, + pid_to_user(msq->q_lspid), + pid_to_user(msq->q_lrpid), msq->q_perm.uid, msq->q_perm.gid, msq->q_perm.cuid, diff --git a/ipc/sem.c b/ipc/sem.c index 19af028..77b4161 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -74,6 +74,7 @@ #include #include #include +#include #include #include "util.h" @@ -721,7 +722,7 @@ static int semctl_main(int semid, int se err = curr->semval; goto out_unlock; case GETPID: - err = curr->sempid; + err = pid_to_user(curr->sempid); goto out_unlock; case GETNCNT: err = count_semncnt(sma,semnum); diff --git a/ipc/shm.c b/ipc/shm.c index dca9048..795a779 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -29,6 +29,7 @@ #include #include #include +#include #include @@ -499,8 +500,8 @@ asmlinkage long sys_shmctl (int shmid, i tbuf.shm_atime = shp->shm_atim; tbuf.shm_dtime = shp->shm_dtim; tbuf.shm_ctime = shp->shm_ctim; - tbuf.shm_cpid = shp->shm_cprid; - tbuf.shm_lpid = shp->shm_lprid; + tbuf.shm_cpid = pid_to_user(shp->shm_cprid); + tbuf.shm_lpid = pid_to_user(shp->shm_lprid); if (!is_file_hugepages(shp->shm_file)) tbuf.shm_nattch = shp->shm_nattch; else @@ -887,8 +888,8 @@ static int sysvipc_shm_proc_show(struct shp->id, shp->shm_flags, shp->shm_segsz, - shp->shm_cprid, - shp->shm_lprid, + pid_to_user(shp->shm_cprid), + pid_to_user(shp->shm_lprid), is_file_hugepages(shp->shm_file) ? (file_count(shp->shm_file) - 1) : shp->shm_nattch, shp->shm_perm.uid, shp->shm_perm.gid, -- 1.0.GIT