From owner-p4-projects Sat Jun 29 13:26:11 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 87A2A37B408; Sat, 29 Jun 2002 13:26:05 -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 DC46D37B400 for ; Sat, 29 Jun 2002 13:26:04 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C14743E09 for ; Sat, 29 Jun 2002 13:26:04 -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.4/8.12.4) with ESMTP id g5TKQ4JU075083 for ; Sat, 29 Jun 2002 13:26:04 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g5TKQ4lm075080 for perforce@freebsd.org; Sat, 29 Jun 2002 13:26:04 -0700 (PDT) Date: Sat, 29 Jun 2002 13:26:04 -0700 (PDT) Message-Id: <200206292026.g5TKQ4lm075080@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 13616 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=13616 Change 13616 by rwatson@rwatson_curry on 2002/06/29 13:25:25 Remove use of Giant from __mac_set_proc(). Call mac_internalize() while not holding the proc lock, since it may allocate memory, which can result in sleeping. Affected files ... .. //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#154 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#154 (text+ko) ==== @@ -2338,26 +2338,21 @@ if (error) return (error); + error = mac_internalize(&intlabel, &extmac); + if (error) + return (error); + newcred = crget(); p = td->td_proc; - mtx_lock(&Giant); PROC_LOCK(p); oldcred = p->p_ucred; - error = mac_internalize(&intlabel, &extmac); - if (error) { - crfree(newcred); - mtx_unlock(&Giant); - return (error); - } - error = mac_cred_check_relabel_subject(oldcred, &intlabel); if (error) { PROC_UNLOCK(p); mac_destroy_temp(&intlabel); crfree(newcred); - mtx_unlock(&Giant); return (error); } @@ -2368,10 +2363,8 @@ p->p_ucred = newcred; PROC_UNLOCK(p); - crfree(oldcred); mac_destroy_temp(&intlabel); - mtx_unlock(&Giant); return (0); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message