From owner-p4-projects Sun Jul 21 7: 4:49 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1A8A737B401; Sun, 21 Jul 2002 07:04:44 -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 A028837B400 for ; Sun, 21 Jul 2002 07:04:43 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A4B143E31 for ; Sun, 21 Jul 2002 07:04:43 -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 g6LE4gJU076948 for ; Sun, 21 Jul 2002 07:04:43 -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 g6LE4gJw076945 for perforce@freebsd.org; Sun, 21 Jul 2002 07:04:42 -0700 (PDT) Date: Sun, 21 Jul 2002 07:04:42 -0700 (PDT) Message-Id: <200207211404.g6LE4gJw076945@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 14599 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=14599 Change 14599 by rwatson@rwatson_curry on 2002/07/21 07:03:46 Add comments for places where we'll need access control checks. Specifically: - O_TRUNC on open - O_CREAT open case Affected files ... .. //depot/projects/trustedbsd/mac/sys/kern/vfs_syscalls.c#54 edit .. //depot/projects/trustedbsd/mac/sys/kern/vfs_vnops.c#22 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/kern/vfs_syscalls.c#54 (text+ko) ==== @@ -1800,6 +1800,9 @@ VATTR_NULL(&vat); vat.va_size = 0; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); +#ifdef MAC + /* XXXMAC: Truncation check here. */ +#endif error = VOP_SETATTR(vp, &vat, td->td_ucred, td); VOP_UNLOCK(vp, 0, td); vn_finished_write(mp); @@ -4477,6 +4480,9 @@ } VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); /* XXX */ +#ifdef MAC + /* XXXMAC: Truncation check here. */ +#endif VATTR_NULL(vap); vap->va_size = 0; error = VOP_SETATTR(vp, vap, td->td_ucred, td); ==== //depot/projects/trustedbsd/mac/sys/kern/vfs_vnops.c#22 (text+ko) ==== @@ -212,6 +212,11 @@ if (fmode & O_APPEND) mode |= VAPPEND; #ifdef MAC + /* + * XXXMAC: Note that for newly created files, we never + * perform an open check. This is probably wrong, but if + * we add it, the failure modes need to be right. + */ error = mac_cred_check_open_vnode(cred, vp, mode); if (error) goto bad; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message