summaryrefslogtreecommitdiffstats
path: root/sys/security/mac_test/mac_test.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-10-05 21:23:47 +0000
committerrwatson <rwatson@FreeBSD.org>2002-10-05 21:23:47 +0000
commit74ec128a1cc11d5f9f7620636ba845fe578a57fc (patch)
treec761fa053a4d22f10903c9ddd53565b138238188 /sys/security/mac_test/mac_test.c
parent6fbe1ed04632e261e3e7c04a4047222500fd0078 (diff)
downloadFreeBSD-src-74ec128a1cc11d5f9f7620636ba845fe578a57fc.zip
FreeBSD-src-74ec128a1cc11d5f9f7620636ba845fe578a57fc.tar.gz
Modify label allocation semantics for sockets: pass in soalloc's malloc
flags so that we can call malloc with M_NOWAIT if necessary, avoiding potential sleeps while holding mutexes in the TCP syncache code. Similar to the existing support for mbuf label allocation: if we can't allocate all the necessary label store in each policy, we back out the label allocation and fail the socket creation. Sync from MAC tree. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
Diffstat (limited to 'sys/security/mac_test/mac_test.c')
-rw-r--r--sys/security/mac_test/mac_test.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/security/mac_test/mac_test.c b/sys/security/mac_test/mac_test.c
index 6727aa7..c1caa44 100644
--- a/sys/security/mac_test/mac_test.c
+++ b/sys/security/mac_test/mac_test.c
@@ -277,20 +277,22 @@ mac_test_init_mount_fs_label(struct label *label)
atomic_add_int(&init_count_mount_fslabel, 1);
}
-static void
-mac_test_init_socket_label(struct label *label)
+static int
+mac_test_init_socket_label(struct label *label, int flag)
{
SLOT(label) = SOCKETMAGIC;
atomic_add_int(&init_count_socket, 1);
+ return (0);
}
-static void
-mac_test_init_socket_peer_label(struct label *label)
+static int
+mac_test_init_socket_peer_label(struct label *label, int flag)
{
SLOT(label) = SOCKETMAGIC;
atomic_add_int(&init_count_socket_peerlabel, 1);
+ return (0);
}
static void
OpenPOWER on IntegriCloud