freebsd-skq/sys
Christian S.J. Peron 826cef3d75 Fix LOR between the syncache and inpcb locks when MAC is present in the
kernel.  This LOR snuck in with some of the recent syncache changes.  To
fix this, the inpcb handling was changed:

- Hang a MAC label off the syncache object
- When the syncache entry is initially created, we pickup the PCB lock
  is held because we extract information from it while initializing the
  syncache entry.  While we do this, copy the MAC label associated with
  the PCB and use it for the syncache entry.
- When the packet is transmitted, copy the label from the syncache entry
  to the mbuf so it can be processed by security policies which analyze
  mbuf labels.

This change required that the MAC framework be extended to support the
label copy operations from the PCB to the syncache entry, and then from
the syncache entry to the mbuf.

These functions really should be referencing the syncache structure instead
of the label.  However, due to some of the complexities associated with
exposing this syncache structure we operate directly on it's label pointer.
This should be OK since we aren't making any access control decisions within
this code directly, we are merely allocating and copying label storage so
we can properly initialize mbuf labels for any packets the syncache code
might create.

This also has a nice side effect of caching.  Prior to this change, the
PCB would be looked up/locked for each packet transmitted.  Now the label
is cached at the time the syncache entry is initialized.

Submitted by:	andre [1]
Discussed with:	rwatson

[1] andre submitted the tcp_syncache.c changes
2006-12-13 06:00:57 +00:00
..
amd64 Add msk(4) to the list of drivers supported by GENERIC kernel. 2006-12-13 03:41:47 +00:00
arm Handle a missing NPE firmware file better; if it's missing print a 2006-12-07 00:49:33 +00:00
boot Add an entry for the msk(4) module. 2006-12-13 02:48:22 +00:00
bsm Merge OpenBSM 1.0 alpha 12 import changes into src/sys/bsm. New events 2006-09-25 12:22:07 +00:00
cam Make cam_xpt's pronouncements match camcontrol 2006-12-10 05:37:48 +00:00
coda change vop_lock handling to allowing tracking of callers' file and line for 2006-11-13 05:51:22 +00:00
compat MFP4: 109653 2006-12-04 22:46:09 +00:00
conf Hook up msk(4) to the build. 2006-12-13 02:37:48 +00:00
contrib Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
crypto Initialize T1 to silent gcc warning. 2006-10-22 02:19:33 +00:00
ddb Threading cleanup.. part 2 of several. 2006-12-06 06:34:57 +00:00
dev Add msk(4), a driver for Marvell/SysKonnect Yukon II Gigabit Ethernet 2006-12-13 02:30:11 +00:00
fs Remove unused variable in unionfs_root(). 2006-12-09 17:24:18 +00:00
gdb Convert to new console api 2006-05-26 13:54:27 +00:00
geom Softc may be NULL in g_journal_orphan(), so don't be surprised. 2006-12-02 09:10:29 +00:00
gnu Previously, the mount_ext2fs binary listed the acceptable mount 2006-11-18 18:22:11 +00:00
i4b Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
i386 Add msk(4) to the list of drivers supported by GENERIC kernel. 2006-12-13 03:41:47 +00:00
ia64 Threading cleanup.. part 2 of several. 2006-12-06 06:34:57 +00:00
isa Optimized RTC accesses by avoiding null writes to the index register 2006-12-03 03:49:28 +00:00
isofs/cd9660 The ISO9660 spec does allow files up to 4G. Change the i_size 2006-12-08 07:43:53 +00:00
kern Add a function to return the MD interrupt source cookie associated with 2006-12-12 19:20:19 +00:00
libkern Add strstr() function to the libkern. 2006-08-12 15:28:39 +00:00
modules Hook up msk(4) to the build. 2006-12-13 02:37:48 +00:00
net MFp4: 92972, 98913 + one more change 2006-12-12 12:17:58 +00:00
net80211 Fix packing on the country band descriptor. No real change since this 2006-12-01 18:40:51 +00:00
netatalk Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
netatm Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
netgraph Correctly calculate length of IP header. 2006-12-12 12:35:06 +00:00
netinet Fix LOR between the syncache and inpcb locks when MAC is present in the 2006-12-13 06:00:57 +00:00
netinet6 MFp4: 92972, 98913 + one more change 2006-12-12 12:17:58 +00:00
netipsec MFp4: 92972, 98913 + one more change 2006-12-12 12:17:58 +00:00
netipx Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
netkey With exception of the if_name() macro, all definitions in net_osdep.h 2006-08-04 21:27:40 +00:00
netnatm Change semantics of socket close and detach. Add a new protocol switch 2006-07-21 17:11:15 +00:00
netncp Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
netsmb Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
nfs NFSv4 client: 2006-11-28 19:33:28 +00:00
nfs4client NFSv4 client: 2006-11-28 19:33:28 +00:00
nfsclient NetApp filers return corrupt post op attrs in the wcc on NFS error responses. 2006-12-11 19:54:25 +00:00
nfsserver MFp4: 92972, 98913 + one more change 2006-12-12 12:17:58 +00:00
opencrypto When DIAGNOSTIC is defined, verify if we don't free crypto requests from 2006-06-06 15:04:52 +00:00
pc98 Allow machdep.cpu_idle_hlt to be set from the loader. This should allow 2006-12-06 18:27:17 +00:00
pccard
pci - Revert the parts of the previous revision which reloaded the watchdog 2006-12-08 03:18:16 +00:00
powerpc Implement bus_space_map(). 2006-12-13 03:25:31 +00:00
rpc
security Fix LOR between the syncache and inpcb locks when MAC is present in the 2006-12-13 06:00:57 +00:00
sparc64 Do explicit bounds checking as a function of the actual size of the 2006-12-10 04:18:03 +00:00
sun4v workaround kernel malloc's brittleness 2006-12-12 03:50:06 +00:00
sys Fix LOR between the syncache and inpcb locks when MAC is present in the 2006-12-13 06:00:57 +00:00
tools Check for errors when registering and unregistering firmware modules. This 2006-06-16 21:06:03 +00:00
ufs change vop_lock handling to allowing tracking of callers' file and line for 2006-11-13 05:51:22 +00:00
vm Remove the requirement that phys_avail be sorted in ascending order 2006-12-08 08:44:47 +00:00
Makefile o Add cam to a list of cscope dirs. 2006-11-26 18:27:16 +00:00