Page MenuHomeFreeBSD

D25600.diff
No OneTemporary

D25600.diff

Index: head/lib/libc/sys/msgctl.2
===================================================================
--- head/lib/libc/sys/msgctl.2
+++ head/lib/libc/sys/msgctl.2
@@ -31,7 +31,7 @@
.\"
.\" $FreeBSD$
.\"/
-.Dd July 9, 2009
+.Dd July 9, 2020
.Dt MSGCTL 2
.Os
.Sh NAME
@@ -63,8 +63,6 @@
.Bd -literal
struct msqid_ds {
struct ipc_perm msg_perm; /* msg queue permission bits */
- struct msg *__msg_first; /* kernel data, don't use */
- struct msg *__msg_last; /* kernel data, don't use */
msglen_t msg_cbytes; /* number of bytes in use on the queue */
msgqnum_t msg_qnum; /* number of msgs in the queue */
msglen_t msg_qbytes; /* max # of bytes on the queue */
Index: head/sys/kern/sysv_msg.c
===================================================================
--- head/sys/kern/sysv_msg.c
+++ head/sys/kern/sysv_msg.c
@@ -613,6 +613,13 @@
*msqbuf = msqkptr->u;
if (td->td_ucred->cr_prison != msqkptr->cred->cr_prison)
msqbuf->msg_perm.key = IPC_PRIVATE;
+
+ /*
+ * Try to hide the fact that the structure layout is shared by
+ * both the kernel and userland. These pointers are not useful
+ * to userspace.
+ */
+ msqbuf->__msg_first = msqbuf->__msg_last = NULL;
break;
default:

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 7, 3:38 PM (7 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29373026
Default Alt Text
D25600.diff (1 KB)

Event Timeline