This commit was manufactured by cvs2svn to create branch
[linux-2.6.git] / ipc / msg.c
index 63777b6..c4d3b2a 100644 (file)
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -24,6 +24,8 @@
 #include <linux/list.h>
 #include <linux/security.h>
 #include <linux/sched.h>
+#include <linux/vs_base.h>
+
 #include <asm/current.h>
 #include <asm/uaccess.h>
 #include "util.h"
@@ -96,6 +98,7 @@ static int newque (key_t key, int msgflg)
 
        msq->q_perm.mode = (msgflg & S_IRWXUGO);
        msq->q_perm.key = key;
+       msq->q_perm.xid = current->xid;
 
        msq->q_perm.security = NULL;
        retval = security_msg_queue_alloc(msq);
@@ -788,7 +791,11 @@ static int sysvipc_msg_read_proc(char *buffer, char **start, off_t offset, int l
        for(i = 0; i <= msg_ids.max_id; i++) {
                struct msg_queue * msq;
                msq = msg_lock(i);
-               if(msq != NULL) {
+               if (msq) {
+                       if (!vx_check(msq->q_perm.xid, VX_IDENT)) {
+                               msg_unlock(msq);
+                               continue;       
+                       }
                        len += sprintf(buffer + len, "%10d %10d  %4o  %10lu %10lu %5u %5u %5u %5u %5u %5u %10lu %10lu %10lu\n",
                                msq->q_perm.key,
                                msg_buildid(i,msq->q_perm.seq),