From e9b7aa2f5981bc0df2020d2c17d8b8bec385e7c8 Mon Sep 17 00:00:00 2001 From: rwatson Date: Wed, 31 Jul 2002 03:03:22 +0000 Subject: 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 --- sys/kern/uipc_sockbuf.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sys/kern/uipc_sockbuf.c') 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 #include /* for aio_swake proto */ #include @@ -43,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -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); -- cgit v1.1