aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 20:18:41 -0800
committerLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 20:18:41 -0800
commitc37fa164f793735b32aa3f53154ff1a7659e6442 (patch)
treebfd5741e0e9b26374f2dc1668905cf6f12c18aba /ipc
parent1d66e22e0f6b1cca563d240f90697b05860dca4d (diff)
downloadhistory-c37fa164f793735b32aa3f53154ff1a7659e6442.tar.gz
v2.4.9.9 -> v2.4.9.10
- Alan Cox: continued merging - Mingming Cao: make msgrcv/shmat check the queue/segment ID's properly - Greg KH: USB serial init failure fix, Xircom serial converter driver - Neil Brown: nsfd/raid/md/lockd cleanups - Ingo Molnar: multipath RAID personality, raid xor update - Hugh Dickins/Marcelo Tosatti: swapin read-ahead race fix - Vojtech Pavlik: fix up some of the infrastructure for x86-64 - Robert Love: AMD 761 AGP GART support - Jens Axboe: fix SCSI-generic queue handling race - me: be sane about page reference bits
Diffstat (limited to 'ipc')
-rw-r--r--ipc/msg.c11
-rw-r--r--ipc/shm.c5
2 files changed, 13 insertions, 3 deletions
diff --git a/ipc/msg.c b/ipc/msg.c
index a2eadc97902355..971bae8d90282d 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -613,7 +613,7 @@ int inline pipelined_send(struct msg_queue* msq, struct msg_msg* msg)
wake_up_process(msr->r_tsk);
} else {
msr->r_msg = msg;
- msq->q_lspid = msr->r_tsk->pid;
+ msq->q_lrpid = msr->r_tsk->pid;
msq->q_rtime = CURRENT_TIME;
wake_up_process(msr->r_tsk);
return 1;
@@ -683,6 +683,9 @@ retry:
goto retry;
}
+ msq->q_lspid = current->pid;
+ msq->q_stime = CURRENT_TIME;
+
if(!pipelined_send(msq,msg)) {
/* noone is waiting for this message, enqueue it */
list_add_tail(&msg->m_list,&msq->q_messages);
@@ -694,8 +697,6 @@ retry:
err = 0;
msg = NULL;
- msq->q_lspid = current->pid;
- msq->q_stime = CURRENT_TIME;
out_unlock_free:
msg_unlock(msqid);
@@ -742,6 +743,10 @@ asmlinkage long sys_msgrcv (int msqid, struct msgbuf *msgp, size_t msgsz,
if(msq==NULL)
return -EINVAL;
retry:
+ err = -EIDRM;
+ if (msg_checkid(msq,msqid))
+ goto out_unlock;
+
err=-EACCES;
if (ipcperms (&msq->q_perm, S_IRUGO))
goto out_unlock;
diff --git a/ipc/shm.c b/ipc/shm.c
index 76602a8649ff74..1c8c5c5cdd25ed 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -606,6 +606,11 @@ asmlinkage long sys_shmat (int shmid, char *shmaddr, int shmflg, ulong *raddr)
shp = shm_lock(shmid);
if(shp == NULL)
return -EINVAL;
+ err = shm_checkid(shp,shmid);
+ if (err) {
+ shm_unlock(shmid);
+ return err;
+ }
if (ipcperms(&shp->shm_perm, acc_mode)) {
shm_unlock(shmid);
return -EACCES;