From owner-p4-projects Tue Mar 25 11:58:28 2003 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CF46337B401; Tue, 25 Mar 2003 11:58:20 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7E9D137B404 for ; Tue, 25 Mar 2003 11:58:20 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E51F643FBF for ; Tue, 25 Mar 2003 11:58:19 -0800 (PST) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h2PJwJ0U092367 for ; Tue, 25 Mar 2003 11:58:19 -0800 (PST) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h2PJwJ6e092364 for perforce@freebsd.org; Tue, 25 Mar 2003 11:58:19 -0800 (PST) Date: Tue, 25 Mar 2003 11:58:19 -0800 (PST) Message-Id: <200303251958.h2PJwJ6e092364@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 27370 for review To: Perforce Change Reviews X-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL,PATCH_UNIFIED_DIFF,X_AUTH_WARNING autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=27370 Change 27370 by rwatson@rwatson_tislabs on 2003/03/25 11:57:55 Move the IP Fragment Reassembly Queue interfaces to the class of entry points that accepts a malloc() flags argument to determine whether or not blocking is permitted (and hence whether or not failure is permitted). Move us towards addressing some more netisr Witness warnings from th advent of network stack locking. Affected files ... .. //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#377 edit .. //depot/projects/trustedbsd/mac/sys/netinet/ip_input.c#27 edit .. //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.c#200 edit .. //depot/projects/trustedbsd/mac/sys/security/mac_lomac/mac_lomac.c#55 edit .. //depot/projects/trustedbsd/mac/sys/security/mac_mls/mac_mls.c#159 edit .. //depot/projects/trustedbsd/mac/sys/security/mac_none/mac_none.c#118 edit .. //depot/projects/trustedbsd/mac/sys/security/mac_test/mac_test.c#95 edit .. //depot/projects/trustedbsd/mac/sys/sys/mac.h#231 edit .. //depot/projects/trustedbsd/mac/sys/sys/mac_policy.h#183 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#377 (text+ko) ==== @@ -697,15 +697,23 @@ mac_init_ifnet_label(&ifp->if_label); } -void -mac_init_ipq(struct ipq *ipq) +int +mac_init_ipq(struct ipq *ipq, int flag) { + int error; mac_init_label(&ipq->ipq_label); - MAC_PERFORM(init_ipq_label, &ipq->ipq_label); + + MAC_CHECK(init_ipq_label, &ipq->ipq_label, flag); + if (error) { + MAC_PERFORM(destroy_ipq_label, &ipq->ipq_label); + mac_destroy_label(&ipq->ipq_label); + } #ifdef MAC_DEBUG - atomic_add_int(&nmacipqs, 1); + if (error == 0) + atomic_add_int(&nmacipqs, 1); #endif + return (error); } int ==== //depot/projects/trustedbsd/mac/sys/netinet/ip_input.c#27 (text+ko) ==== @@ -983,7 +983,10 @@ goto dropfrag; fp = mtod(t, struct ipq *); #ifdef MAC - mac_init_ipq(fp); + if (mac_init_ipq(fp, M_NOWAIT) != 0) { + m_free(t); + goto dropfrag; + } mac_create_ipq(m, fp); #endif TAILQ_INSERT_HEAD(head, fp, ipq_list); ==== //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.c#200 (text+ko) ==== @@ -2640,7 +2640,7 @@ .mpo_init_cred_label = mac_biba_init_label, .mpo_init_devfsdirent_label = mac_biba_init_label, .mpo_init_ifnet_label = mac_biba_init_label, - .mpo_init_ipq_label = mac_biba_init_label, + .mpo_init_ipq_label = mac_biba_init_label_waitcheck, .mpo_init_mbuf_label = mac_biba_init_label_waitcheck, .mpo_init_mount_label = mac_biba_init_label, .mpo_init_mount_fs_label = mac_biba_init_label, ==== //depot/projects/trustedbsd/mac/sys/security/mac_lomac/mac_lomac.c#55 (text+ko) ==== @@ -2645,7 +2645,7 @@ .mpo_init_cred_label = mac_lomac_init_label, .mpo_init_devfsdirent_label = mac_lomac_init_label, .mpo_init_ifnet_label = mac_lomac_init_label, - .mpo_init_ipq_label = mac_lomac_init_label, + .mpo_init_ipq_label = mac_lomac_init_label_waitcheck, .mpo_init_mbuf_label = mac_lomac_init_label_waitcheck, .mpo_init_mount_label = mac_lomac_init_label, .mpo_init_mount_fs_label = mac_lomac_init_label, ==== //depot/projects/trustedbsd/mac/sys/security/mac_mls/mac_mls.c#159 (text+ko) ==== @@ -2413,7 +2413,7 @@ .mpo_init_cred_label = mac_mls_init_label, .mpo_init_devfsdirent_label = mac_mls_init_label, .mpo_init_ifnet_label = mac_mls_init_label, - .mpo_init_ipq_label = mac_mls_init_label, + .mpo_init_ipq_label = mac_mls_init_label_waitcheck, .mpo_init_mbuf_label = mac_mls_init_label_waitcheck, .mpo_init_mount_label = mac_mls_init_label, .mpo_init_mount_fs_label = mac_mls_init_label, ==== //depot/projects/trustedbsd/mac/sys/security/mac_none/mac_none.c#118 (text+ko) ==== @@ -976,7 +976,7 @@ .mpo_init_cred_label = mac_none_init_label, .mpo_init_devfsdirent_label = mac_none_init_label, .mpo_init_ifnet_label = mac_none_init_label, - .mpo_init_ipq_label = mac_none_init_label, + .mpo_init_ipq_label = mac_none_init_label_waitcheck, .mpo_init_mbuf_label = mac_none_init_label_waitcheck, .mpo_init_mount_label = mac_none_init_label, .mpo_init_mount_fs_label = mac_none_init_label, ==== //depot/projects/trustedbsd/mac/sys/security/mac_test/mac_test.c#95 (text+ko) ==== @@ -242,12 +242,13 @@ atomic_add_int(&init_count_ifnet, 1); } -static void -mac_test_init_ipq_label(struct label *label) +static int +mac_test_init_ipq_label(struct label *label, int flag) { SLOT(label) = IPQMAGIC; atomic_add_int(&init_count_ipq, 1); + return (0); } static int ==== //depot/projects/trustedbsd/mac/sys/sys/mac.h#231 (text+ko) ==== @@ -133,7 +133,7 @@ void mac_init_cred(struct ucred *); void mac_init_devfsdirent(struct devfs_dirent *); void mac_init_ifnet(struct ifnet *); -void mac_init_ipq(struct ipq *); +int mac_init_ipq(struct ipq *, int flag); int mac_init_socket(struct socket *, int flag); void mac_init_pipe(struct pipe *); int mac_init_mbuf(struct mbuf *m, int flag); ==== //depot/projects/trustedbsd/mac/sys/sys/mac_policy.h#183 (text+ko) ==== @@ -73,7 +73,7 @@ void (*mpo_init_cred_label)(struct label *label); void (*mpo_init_devfsdirent_label)(struct label *label); void (*mpo_init_ifnet_label)(struct label *label); - void (*mpo_init_ipq_label)(struct label *label); + int (*mpo_init_ipq_label)(struct label *label, int flag); int (*mpo_init_mbuf_label)(struct label *label, int flag); void (*mpo_init_mount_label)(struct label *label); void (*mpo_init_mount_fs_label)(struct label *label); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message