PERFORCE change 105366 for review
Todd Miller
millert at FreeBSD.org
Wed Aug 30 21:26:11 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=105366
Change 105366 by millert at millert_g4tower on 2006/08/30 21:26:00
Correct label allocation for sysv message queues. This
brings the API back into line with FreeBSD, corrects a bug,
and correctly manages label storage entirely with the MAC
Framework
Affected files ...
.. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/kern/sysv_msg.c#4 edit
.. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_framework.h#3 edit
.. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_sysv_msg.c#3 edit
Differences ...
==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/kern/sysv_msg.c#4 (text+ko) ====
@@ -239,7 +239,7 @@
msqids[i].u.msg_qbytes = 0; /* implies entry is available */
msqids[i].u.msg_perm.seq = 0; /* reset to a known value */
#ifdef MAC
- mac_sysvmsq_init(msqids[i].label);
+ mac_sysvmsq_init(&msqids[i]);
#endif
}
}
@@ -383,7 +383,7 @@
msqptr->u.msg_qbytes = 0; /* Mark it as free */
#ifdef MAC
- mac_sysvmsq_cleanup(msqptr->label);
+ mac_sysvmsq_cleanup(msqptr);
#endif
wakeup((caddr_t)msqptr);
==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_framework.h#3 (text+ko) ====
@@ -98,7 +98,7 @@
void mac_proc_init(struct proc *);
int mac_socket_init(struct socket *, int waitok);
void mac_sysvmsg_init(struct msg *);
-void mac_sysvmsq_init(struct label *);
+void mac_sysvmsq_init(struct msqid_kernel *msqptr);
void mac_sysvsem_init(struct semid_kernel*);
void mac_sysvshm_init(struct shmid_kernel*);
void mac_vnode_init(struct vnode *vp);
@@ -248,7 +248,7 @@
* object to a pool. This hook does not replace the mac_destroy hooks.
*/
void mac_sysvmsg_cleanup(struct msg *msgptr);
-void mac_sysvmsq_cleanup(struct label *msqlabel);
+void mac_sysvmsq_cleanup(struct msqid_kernel *msqptr);
void mac_sysvsem_cleanup(struct semid_kernel *semakptr);
void mac_sysvshm_cleanup(struct shmid_kernel *shmsegptr);
void mac_vnode_cleanup(struct vnode *vp);
==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/security/mac_sysv_msg.c#3 (text+ko) ====
@@ -50,9 +50,10 @@
}
void
-mac_sysvmsq_init(struct label *label)
+mac_sysvmsq_init(struct msqid_kernel *msqptr)
{
- label = mac_sysv_msgqueue_alloc_label();
+
+ msqptr->label = mac_sysv_msgqueue_alloc_label();
}
void
@@ -79,10 +80,10 @@
}
void
-mac_sysvmsq_cleanup(struct label *msqlabel)
+mac_sysvmsq_cleanup(struct msqid_kernel *msqptr)
{
- MAC_PERFORM(sysvmsq_cleanup, msqlabel);
+ MAC_PERFORM(sysvmsq_cleanup, msqptr->label);
}
int
More information about the trustedbsd-cvs
mailing list