From owner-p4-projects Wed Mar 5 12:17:24 2003 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5BF8437B405; Wed, 5 Mar 2003 12:17:22 -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 E487537B401 for ; Wed, 5 Mar 2003 12:17:21 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8CA1243F3F for ; Wed, 5 Mar 2003 12:17:21 -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 h25KHL0U090016 for ; Wed, 5 Mar 2003 12:17:21 -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 h25KHKWe090013 for perforce@freebsd.org; Wed, 5 Mar 2003 12:17:20 -0800 (PST) Date: Wed, 5 Mar 2003 12:17:20 -0800 (PST) Message-Id: <200303052017.h25KHKWe090013@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 26386 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://perforce.freebsd.org/chv.cgi?CH=26386 Change 26386 by rwatson@rwatson_tislabs on 2003/03/05 12:17:00 Correct a bug in the handling of mac_check_vnode_setflags() werein an uninitialized value is passed to the MAC Framework. Restructure the code a bit to look like the checks for setowner, setmode by initializing the vattr structure regardless of success of the MAC check. This isn't the exact patch submitted, as a result. Submitted by: mike halderman Affected files ... .. //depot/projects/trustedbsd/mac/sys/kern/vfs_syscalls.c#100 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/kern/vfs_syscalls.c#100 (text+ko) ==== @@ -1943,16 +1943,13 @@ return (error); VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + VATTR_NULL(&vattr); + vattr.va_flags = flags; #ifdef MAC error = mac_check_vnode_setflags(td->td_ucred, vp, vattr.va_flags); - if (error == 0) { + if (error == 0) #endif - VATTR_NULL(&vattr); - vattr.va_flags = flags; error = VOP_SETATTR(vp, &vattr, td->td_ucred, td); -#ifdef MAC - } -#endif VOP_UNLOCK(vp, 0, td); vn_finished_write(mp); return (error); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message