Date: Wed, 5 Mar 2003 12:17:20 -0800 (PST) From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 26386 for review Message-ID: <200303052017.h25KHKWe090013@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <mrh@spawar.navy.mil> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303052017.h25KHKWe090013>