summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_output.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-07-31 19:06:49 +0000
committerrwatson <rwatson@FreeBSD.org>2002-07-31 19:06:49 +0000
commita034d0cd3c7f0d940efed7491eb32a5501cc7f88 (patch)
tree5dbdb791ab0455bfa5e2c41167f506be54ce9568 /sys/netinet/tcp_output.c
parentcf35cc4c684ae09caa3774b8e8971b0a1adfe19a (diff)
downloadFreeBSD-src-a034d0cd3c7f0d940efed7491eb32a5501cc7f88.zip
FreeBSD-src-a034d0cd3c7f0d940efed7491eb32a5501cc7f88.tar.gz
Introduce support for Mandatory Access Control and extensible
kernel access control. Instrument the TCP socket code for packet generation and delivery: label outgoing mbufs with the label of the socket, and check socket and mbuf labels before permitting delivery to a socket. Assign labels to newly accepted connections when the syncache/cookie code has done its business. Also set peer labels as convenient. Currently, MAC policies cannot influence the PCB matching algorithm, so cannot implement polyinstantiation. Note that there is at least one case where a PCB is not available due to the TCP packet not being associated with any socket, so we don't label in that case, but need to handle it in a special manner. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'sys/netinet/tcp_output.c')
-rw-r--r--sys/netinet/tcp_output.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index 47a1873..9fc5c31 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -36,6 +36,7 @@
#include "opt_inet6.h"
#include "opt_ipsec.h"
+#include "opt_mac.h"
#include "opt_tcpdebug.h"
#include <sys/param.h>
@@ -43,6 +44,7 @@
#include <sys/domain.h>
#include <sys/kernel.h>
#include <sys/lock.h>
+#include <sys/mac.h>
#include <sys/mbuf.h>
#include <sys/mutex.h>
#include <sys/protosw.h>
@@ -639,6 +641,9 @@ send:
m->m_len = hdrlen;
}
m->m_pkthdr.rcvif = (struct ifnet *)0;
+#ifdef MAC
+ mac_create_mbuf_from_socket(so, m);
+#endif
#ifdef INET6
if (isipv6) {
ip6 = mtod(m, struct ip6_hdr *);
OpenPOWER on IntegriCloud