aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_output.c
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2002-07-31 19:06:49 +0000
committerRobert Watson <rwatson@FreeBSD.org>2002-07-31 19:06:49 +0000
commitc488362e1a68c12db2b84696bf565ae3be421a36 (patch)
tree5dbdb791ab0455bfa5e2c41167f506be54ce9568 /sys/netinet/tcp_output.c
parent239b5b9707e056e91f3822c1d0d00c8d156209c6 (diff)
downloadsrc-c488362e1a68c12db2b84696bf565ae3be421a36.tar.gz
src-c488362e1a68c12db2b84696bf565ae3be421a36.zip
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
Notes
Notes: svn path=/head/; revision=101106
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 47a187360b54..9fc5c318cf7e 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 *);