diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2009-06-03 18:46:28 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2009-06-03 18:46:28 +0000 |
commit | 3de4046939a04576ede9d97f48f6a02d1a2ccc8c (patch) | |
tree | c959f41a3828e52e4d9970ee9fff5c64a88ca36e /sys/netinet/in_pcb.c | |
parent | 097695e97aae6604b78e60aafcf3aebdfc9dbe92 (diff) | |
download | src-3de4046939a04576ede9d97f48f6a02d1a2ccc8c.tar.gz src-3de4046939a04576ede9d97f48f6a02d1a2ccc8c.zip |
Continue work to optimize performance of "options MAC" when no MAC policy
modules are loaded by avoiding mbuf label lookups when policies aren't
loaded, pushing further socket locking into MAC policy modules, and
avoiding locking MAC ifnet locks when no policies are loaded:
- Check mac_policies_count before looking for mbuf MAC label m_tags in MAC
Framework entry points. We will still pay label lookup costs if MAC
policies are present but don't require labels (typically a single mbuf
header field read, but perhaps further indirection if IPSEC or other
m_tag consumers are in use).
- Further push socket locking for socket-related access control checks and
events into MAC policies from the MAC Framework, so that sockets are
only locked if a policy specifically requires a lock to protect a label.
This resolves lock order issues during sonewconn() and also in local
domain socket cross-connect where multiple socket locks could not be
held at once for the purposes of propagatig MAC labels across multiple
sockets. Eliminate mac_policy_count check in some entry points where it
no longer avoids locking.
- Add mac_policy_count checking in some entry points relating to network
interfaces that otherwise lock a global MAC ifnet lock used to protect
ifnet labels.
Obtained from: TrustedBSD Project
Notes
Notes:
svn path=/head/; revision=193391
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r-- | sys/netinet/in_pcb.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 0b4ef27131a5..140f41a99f4a 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -212,9 +212,7 @@ in_pcballoc(struct socket *so, struct inpcbinfo *pcbinfo) error = mac_inpcb_init(inp, M_NOWAIT); if (error != 0) goto out; - SOCK_LOCK(so); mac_inpcb_create(so, inp); - SOCK_UNLOCK(so); #endif #ifdef IPSEC error = ipsec_init_policy(so, &inp->inp_sp); |