summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_sockbuf.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-07-31 03:03:22 +0000
committerrwatson <rwatson@FreeBSD.org>2002-07-31 03:03:22 +0000
commite9b7aa2f5981bc0df2020d2c17d8b8bec385e7c8 (patch)
treed42e6b86c134ad9ea9f6c274e39fe61df8aa248d /sys/kern/uipc_sockbuf.c
parentea303967f6e6154b6955681845c280836593153c (diff)
downloadFreeBSD-src-e9b7aa2f5981bc0df2020d2c17d8b8bec385e7c8.zip
FreeBSD-src-e9b7aa2f5981bc0df2020d2c17d8b8bec385e7c8.tar.gz
Introduce support for Mandatory Access Control and extensible
kernel access control. Invoke the necessary MAC entry points to maintain labels on sockets. In particular, invoke entry points during socket allocation and destruction, as well as creation by a process or during an accept-scenario (sonewconn). For UNIX domain sockets, also assign a peer label. As the socket code isn't locked down yet, locking interactions are not yet clear. Various protocol stack socket operations (such as peer label assignment for IPv4) will follow. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'sys/kern/uipc_sockbuf.c')
-rw-r--r--sys/kern/uipc_sockbuf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c
index 8b36396..45b356e 100644
--- a/sys/kern/uipc_sockbuf.c
+++ b/sys/kern/uipc_sockbuf.c
@@ -34,7 +34,9 @@
* $FreeBSD$
*/
+#include "opt_mac.h"
#include "opt_param.h"
+
#include <sys/param.h>
#include <sys/aio.h> /* for aio_swake proto */
#include <sys/domain.h>
@@ -43,6 +45,7 @@
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/malloc.h>
+#include <sys/mac.h>
#include <sys/mbuf.h>
#include <sys/mutex.h>
#include <sys/proc.h>
@@ -195,6 +198,9 @@ sonewconn(head, connstatus)
so->so_proto = head->so_proto;
so->so_timeo = head->so_timeo;
so->so_cred = crhold(head->so_cred);
+#ifdef MAC
+ mac_create_socket_from_socket(head, so);
+#endif
if (soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat) ||
(*so->so_proto->pr_usrreqs->pru_attach)(so, 0, NULL)) {
sotryfree(so);
OpenPOWER on IntegriCloud