aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
Diffstat (limited to 'ipc')
-rw-r--r--ipc/mqueue.c7
-rw-r--r--ipc/msg.c6
-rw-r--r--ipc/sem.c8
-rw-r--r--ipc/shm.c6
4 files changed, 15 insertions, 12 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 20f1fed8fa48..c0b26dc4617b 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -29,6 +29,8 @@
29#include <linux/audit.h> 29#include <linux/audit.h>
30#include <linux/signal.h> 30#include <linux/signal.h>
31#include <linux/mutex.h> 31#include <linux/mutex.h>
32#include <linux/nsproxy.h>
33#include <linux/pid.h>
32 34
33#include <net/sock.h> 35#include <net/sock.h>
34#include "util.h" 36#include "util.h"
@@ -330,7 +332,8 @@ static ssize_t mqueue_read_file(struct file *filp, char __user *u_data,
330 (info->notify_owner && 332 (info->notify_owner &&
331 info->notify.sigev_notify == SIGEV_SIGNAL) ? 333 info->notify.sigev_notify == SIGEV_SIGNAL) ?
332 info->notify.sigev_signo : 0, 334 info->notify.sigev_signo : 0,
333 pid_nr(info->notify_owner)); 335 pid_nr_ns(info->notify_owner,
336 current->nsproxy->pid_ns));
334 spin_unlock(&info->lock); 337 spin_unlock(&info->lock);
335 buffer[sizeof(buffer)-1] = '\0'; 338 buffer[sizeof(buffer)-1] = '\0';
336 slen = strlen(buffer)+1; 339 slen = strlen(buffer)+1;
@@ -507,7 +510,7 @@ static void __do_notify(struct mqueue_inode_info *info)
507 sig_i.si_errno = 0; 510 sig_i.si_errno = 0;
508 sig_i.si_code = SI_MESGQ; 511 sig_i.si_code = SI_MESGQ;
509 sig_i.si_value = info->notify.sigev_value; 512 sig_i.si_value = info->notify.sigev_value;
510 sig_i.si_pid = current->tgid; 513 sig_i.si_pid = task_pid_vnr(current);
511 sig_i.si_uid = current->uid; 514 sig_i.si_uid = current->uid;
512 515
513 kill_pid_info(info->notify.sigev_signo, 516 kill_pid_info(info->notify.sigev_signo,
diff --git a/ipc/msg.c b/ipc/msg.c
index a03fcb522fff..319468609b76 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -611,7 +611,7 @@ static inline int pipelined_send(struct msg_queue *msq, struct msg_msg *msg)
611 msr->r_msg = ERR_PTR(-E2BIG); 611 msr->r_msg = ERR_PTR(-E2BIG);
612 } else { 612 } else {
613 msr->r_msg = NULL; 613 msr->r_msg = NULL;
614 msq->q_lrpid = msr->r_tsk->pid; 614 msq->q_lrpid = task_pid_vnr(msr->r_tsk);
615 msq->q_rtime = get_seconds(); 615 msq->q_rtime = get_seconds();
616 wake_up_process(msr->r_tsk); 616 wake_up_process(msr->r_tsk);
617 smp_mb(); 617 smp_mb();
@@ -695,7 +695,7 @@ long do_msgsnd(int msqid, long mtype, void __user *mtext,
695 } 695 }
696 } 696 }
697 697
698 msq->q_lspid = current->tgid; 698 msq->q_lspid = task_tgid_vnr(current);
699 msq->q_stime = get_seconds(); 699 msq->q_stime = get_seconds();
700 700
701 if (!pipelined_send(msq, msg)) { 701 if (!pipelined_send(msq, msg)) {
@@ -810,7 +810,7 @@ long do_msgrcv(int msqid, long *pmtype, void __user *mtext,
810 list_del(&msg->m_list); 810 list_del(&msg->m_list);
811 msq->q_qnum--; 811 msq->q_qnum--;
812 msq->q_rtime = get_seconds(); 812 msq->q_rtime = get_seconds();
813 msq->q_lrpid = current->tgid; 813 msq->q_lrpid = task_tgid_vnr(current);
814 msq->q_cbytes -= msg->m_ts; 814 msq->q_cbytes -= msg->m_ts;
815 atomic_sub(msg->m_ts, &msg_bytes); 815 atomic_sub(msg->m_ts, &msg_bytes);
816 atomic_dec(&msg_hdrs); 816 atomic_dec(&msg_hdrs);
diff --git a/ipc/sem.c b/ipc/sem.c
index b676fef6d208..64ff4261f4e2 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -795,7 +795,7 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum,
795 for (un = sma->undo; un; un = un->id_next) 795 for (un = sma->undo; un; un = un->id_next)
796 un->semadj[semnum] = 0; 796 un->semadj[semnum] = 0;
797 curr->semval = val; 797 curr->semval = val;
798 curr->sempid = current->tgid; 798 curr->sempid = task_tgid_vnr(current);
799 sma->sem_ctime = get_seconds(); 799 sma->sem_ctime = get_seconds();
800 /* maybe some queued-up processes were waiting for this */ 800 /* maybe some queued-up processes were waiting for this */
801 update_queue(sma); 801 update_queue(sma);
@@ -1196,7 +1196,7 @@ retry_undos:
1196 if (error) 1196 if (error)
1197 goto out_unlock_free; 1197 goto out_unlock_free;
1198 1198
1199 error = try_atomic_semop (sma, sops, nsops, un, current->tgid); 1199 error = try_atomic_semop (sma, sops, nsops, un, task_tgid_vnr(current));
1200 if (error <= 0) { 1200 if (error <= 0) {
1201 if (alter && error == 0) 1201 if (alter && error == 0)
1202 update_queue (sma); 1202 update_queue (sma);
@@ -1211,7 +1211,7 @@ retry_undos:
1211 queue.sops = sops; 1211 queue.sops = sops;
1212 queue.nsops = nsops; 1212 queue.nsops = nsops;
1213 queue.undo = un; 1213 queue.undo = un;
1214 queue.pid = current->tgid; 1214 queue.pid = task_tgid_vnr(current);
1215 queue.id = semid; 1215 queue.id = semid;
1216 queue.alter = alter; 1216 queue.alter = alter;
1217 if (alter) 1217 if (alter)
@@ -1382,7 +1382,7 @@ found:
1382 semaphore->semval = 0; 1382 semaphore->semval = 0;
1383 if (semaphore->semval > SEMVMX) 1383 if (semaphore->semval > SEMVMX)
1384 semaphore->semval = SEMVMX; 1384 semaphore->semval = SEMVMX;
1385 semaphore->sempid = current->tgid; 1385 semaphore->sempid = task_tgid_vnr(current);
1386 } 1386 }
1387 } 1387 }
1388 sma->sem_otime = get_seconds(); 1388 sma->sem_otime = get_seconds();
diff --git a/ipc/shm.c b/ipc/shm.c
index 5fc5cf50cf1b..b9d272900a1e 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -168,7 +168,7 @@ static void shm_open(struct vm_area_struct *vma)
168 shp = shm_lock(sfd->ns, sfd->id); 168 shp = shm_lock(sfd->ns, sfd->id);
169 BUG_ON(!shp); 169 BUG_ON(!shp);
170 shp->shm_atim = get_seconds(); 170 shp->shm_atim = get_seconds();
171 shp->shm_lprid = current->tgid; 171 shp->shm_lprid = task_tgid_vnr(current);
172 shp->shm_nattch++; 172 shp->shm_nattch++;
173 shm_unlock(shp); 173 shm_unlock(shp);
174} 174}
@@ -213,7 +213,7 @@ static void shm_close(struct vm_area_struct *vma)
213 /* remove from the list of attaches of the shm segment */ 213 /* remove from the list of attaches of the shm segment */
214 shp = shm_lock(ns, sfd->id); 214 shp = shm_lock(ns, sfd->id);
215 BUG_ON(!shp); 215 BUG_ON(!shp);
216 shp->shm_lprid = current->tgid; 216 shp->shm_lprid = task_tgid_vnr(current);
217 shp->shm_dtim = get_seconds(); 217 shp->shm_dtim = get_seconds();
218 shp->shm_nattch--; 218 shp->shm_nattch--;
219 if(shp->shm_nattch == 0 && 219 if(shp->shm_nattch == 0 &&
@@ -392,7 +392,7 @@ static int newseg (struct ipc_namespace *ns, key_t key, int shmflg, size_t size)
392 if(id == -1) 392 if(id == -1)
393 goto no_id; 393 goto no_id;
394 394
395 shp->shm_cprid = current->tgid; 395 shp->shm_cprid = task_tgid_vnr(current);
396 shp->shm_lprid = 0; 396 shp->shm_lprid = 0;
397 shp->shm_atim = shp->shm_dtim = 0; 397 shp->shm_atim = shp->shm_dtim = 0;
398 shp->shm_ctim = get_seconds(); 398 shp->shm_ctim = get_seconds();