From owner-p4-projects Tue Oct 1 17:57:15 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A1CC737B404; Tue, 1 Oct 2002 17:57:10 -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 3573C37B401 for ; Tue, 1 Oct 2002 17:57:10 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CF1EA43E65 for ; Tue, 1 Oct 2002 17:57:09 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g920v9Co056424 for ; Tue, 1 Oct 2002 17:57:09 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g920v9WB056421 for perforce@freebsd.org; Tue, 1 Oct 2002 17:57:09 -0700 (PDT) Date: Tue, 1 Oct 2002 17:57:09 -0700 (PDT) Message-Id: <200210020057.g920v9WB056421@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 18506 for review To: Perforce Change Reviews 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://people.freebsd.org/~peter/p4db/chv.cgi?CH=18506 Change 18506 by rwatson@rwatson_paprika on 2002/10/01 17:57:04 Improve consistency of blocking-sensitive label allocation routines: always accept (label, flag) rather than sometimes (how, label). This should correct a page fault during ifconfig. Affected files ... .. //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#288 edit .. //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.c#122 edit .. //depot/projects/trustedbsd/mac/sys/security/mac_mls/mac_mls.c#102 edit .. //depot/projects/trustedbsd/mac/sys/security/mac_none/mac_none.c#78 edit .. //depot/projects/trustedbsd/mac/sys/security/mac_te/mac_te.c#82 edit .. //depot/projects/trustedbsd/mac/sys/security/mac_test/mac_test.c#49 edit .. //depot/projects/trustedbsd/mac/sys/sys/mac.h#168 edit .. //depot/projects/trustedbsd/mac/sys/sys/mac_policy.h#129 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#288 (text+ko) ==== @@ -1149,7 +1149,7 @@ } int -mac_init_mbuf(struct mbuf *m, int how) +mac_init_mbuf(struct mbuf *m, int flag) { int error; @@ -1157,7 +1157,7 @@ mac_init_label(&m->m_pkthdr.label); - MAC_CHECK(init_mbuf_label, how, &m->m_pkthdr.label); + MAC_CHECK(init_mbuf_label, &m->m_pkthdr.label, flag); if (error) { MAC_PERFORM(destroy_mbuf_label, &m->m_pkthdr.label); mac_destroy_label(&m->m_pkthdr.label); ==== //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.c#122 (text+ko) ==== @@ -123,11 +123,11 @@ struct label *vnodelabel, mode_t acc_mode); static struct mac_biba * -biba_alloc(int how) +biba_alloc(int flag) { struct mac_biba *mac_biba; - mac_biba = malloc(sizeof(struct mac_biba), M_MACBIBA, M_ZERO | how); + mac_biba = malloc(sizeof(struct mac_biba), M_MACBIBA, M_ZERO | flag); return (mac_biba); } @@ -461,10 +461,10 @@ } static int -mac_biba_init_label_waitcheck(int how, struct label *label) +mac_biba_init_label_waitcheck(struct label *label, int flag) { - SLOT(label) = biba_alloc(how); + SLOT(label) = biba_alloc(flag); if (SLOT(label) == NULL) return (ENOMEM); ==== //depot/projects/trustedbsd/mac/sys/security/mac_mls/mac_mls.c#102 (text+ko) ==== @@ -112,11 +112,11 @@ struct label *vnodelabel, mode_t acc_mode); static struct mac_mls * -mls_alloc(int how) +mls_alloc(int flag) { struct mac_mls *mac_mls; - mac_mls = malloc(sizeof(struct mac_mls), M_MACMLS, M_ZERO | how); + mac_mls = malloc(sizeof(struct mac_mls), M_MACMLS, M_ZERO | flag); return (mac_mls); } @@ -450,10 +450,10 @@ } static int -mac_mls_init_label_waitcheck(int how, struct label *label) +mac_mls_init_label_waitcheck(struct label *label, int flag) { - SLOT(label) = mls_alloc(how); + SLOT(label) = mls_alloc(flag); if (SLOT(label) == NULL) return (ENOMEM); ==== //depot/projects/trustedbsd/mac/sys/security/mac_none/mac_none.c#78 (text+ko) ==== @@ -115,7 +115,7 @@ } static int -mac_none_init_label_waitcheck(int how, struct label *label) +mac_none_init_label_waitcheck(struct label *label, int flag) { return (0); ==== //depot/projects/trustedbsd/mac/sys/security/mac_te/mac_te.c#82 (text+ko) ==== @@ -187,10 +187,10 @@ sizeof(te_transition_policy[0]); static struct mac_te * -te_alloc(int how) +te_alloc(int flag) { - return (malloc(sizeof(struct mac_te), M_MACTE, M_ZERO | how)); + return (malloc(sizeof(struct mac_te), M_MACTE, M_ZERO | flag)); } static void @@ -214,10 +214,10 @@ } static int -mac_te_init_label_waitcheck(int how, struct label *label) +mac_te_init_label_waitcheck(struct label *label, int flag) { - SLOT(label) = te_alloc(how); + SLOT(label) = te_alloc(flag); if (SLOT(label) == NULL) return (ENOMEM); ==== //depot/projects/trustedbsd/mac/sys/security/mac_test/mac_test.c#49 (text+ko) ==== @@ -250,7 +250,7 @@ } static int -mac_test_init_mbuf_label(int how, struct label *label) +mac_test_init_mbuf_label(struct label *label, int flag) { SLOT(label) = MBUFMAGIC; ==== //depot/projects/trustedbsd/mac/sys/sys/mac.h#168 (text+ko) ==== @@ -235,7 +235,7 @@ void mac_init_ipq(struct ipq *); int mac_init_socket(struct socket *, int flag); void mac_init_pipe(struct pipe *); -int mac_init_mbuf(struct mbuf *m, int how); +int mac_init_mbuf(struct mbuf *m, int flag); void mac_init_mount(struct mount *); void mac_init_proc(struct proc *); void mac_init_vnode(struct vnode *); ==== //depot/projects/trustedbsd/mac/sys/sys/mac_policy.h#129 (text+ko) ==== @@ -77,7 +77,7 @@ 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_mbuf_label)(int how, struct label *label); + int (*mpo_init_mbuf_label)(struct label *label, int flag); void (*mpo_init_mount_label)(struct label *mntlabel); void (*mpo_init_mount_fs_label)(struct label *fslabel); int (*mpo_init_socket_label)(struct label *label, int flag); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message