From owner-p4-projects@FreeBSD.ORG Tue Apr 15 13:45:00 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C141737B404; Tue, 15 Apr 2003 13:44:59 -0700 (PDT) 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 8A02D37B401 for ; Tue, 15 Apr 2003 13:44:59 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 070C343FAF for ; Tue, 15 Apr 2003 13:44:59 -0700 (PDT) (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 h3FKiw0U042054 for ; Tue, 15 Apr 2003 13:44:58 -0700 (PDT) (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 h3FKiwLG042051 for perforce@freebsd.org; Tue, 15 Apr 2003 13:44:58 -0700 (PDT) Date: Tue, 15 Apr 2003 13:44:58 -0700 (PDT) Message-Id: <200304152044.h3FKiwLG042051@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 To: Perforce Change Reviews Subject: PERFORCE change 29015 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2003 20:45:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=29015 Change 29015 by rwatson@rwatson_tislabs on 2003/04/15 13:43:57 Modify mac_test policy to invoke WITNESS_WARN() when a potentially blocking allocation could occur as a result of a label initialization. This will simulate the behavior of allocated label policies such as MLS and Biba when running mac_test from the perspective of WITNESS lock and sleep warnings. Affected files ... .. //depot/projects/trustedbsd/mac/sys/security/mac_test/mac_test.c#99 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/security/mac_test/mac_test.c#99 (text+ko) ==== @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -246,6 +247,11 @@ mac_test_init_ipq_label(struct label *label, int flag) { + if (flag & M_WAITOK) + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "mac_test_init_ipq_label() at %s:%d", __FILE__, + __LINE__); + SLOT(label) = IPQMAGIC; atomic_add_int(&init_count_ipq, 1); return (0); @@ -255,6 +261,11 @@ mac_test_init_mbuf_label(struct label *label, int flag) { + if (flag & M_WAITOK) + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "mac_test_init_mbuf_label() at %s:%d", __FILE__, + __LINE__); + SLOT(label) = MBUFMAGIC; atomic_add_int(&init_count_mbuf, 1); return (0); @@ -280,6 +291,11 @@ mac_test_init_socket_label(struct label *label, int flag) { + if (flag & M_WAITOK) + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "mac_test_init_socket_label() at %s:%d", __FILE__, + __LINE__); + SLOT(label) = SOCKETMAGIC; atomic_add_int(&init_count_socket, 1); return (0); @@ -289,6 +305,11 @@ mac_test_init_socket_peer_label(struct label *label, int flag) { + if (flag & M_WAITOK) + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "mac_test_init_socket_peer_label() at %s:%d", __FILE__, + __LINE__); + SLOT(label) = SOCKETMAGIC; atomic_add_int(&init_count_socket_peerlabel, 1); return (0);