Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jul 2002 00:27:07 -0400 (EDT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Brian Feldman <green@FreeBSD.org>
Cc:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   Re: PERFORCE change 14031 for review
Message-ID:  <Pine.NEB.3.96L.1020712002618.86266A-100000@fledge.watson.org>
In-Reply-To: <200207101502.g6AF2GVj077852@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
I'm not sure this is a good idea -- you may have broken default labels on
read-only multilabel file systems, since you've introduced a new failure
mode.  You've also introduced a write where previously we often did only a
cached read...

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert@fledge.watson.org      Network Associates Laboratories

On Wed, 10 Jul 2002, Brian Feldman wrote:

> http://people.freebsd.org/~peter/p4db/chv.cgi?CH=14031
> 
> Change 14031 by green@green_laptop_2 on 2002/07/10 08:02:13
> 
> 	* Fix a bug where mac_update_vnode_from_externalized would _never_
> 	  get called.  (ALSO: LAZY INSTANTIATE ALL FREEBSD.MAC LABELS)
> 	* Remove mac_create_vnode_from_exported()
> 
> Affected files ...
> 
> .. //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#160 edit
> .. //depot/projects/trustedbsd/mac/sys/sys/mac.h#109 edit
> 
> Differences ...
> 
> ==== //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#160 (text+ko) ====
> 
> @@ -917,10 +917,19 @@
>  
>  	case EOPNOTSUPP:
>  	case ENOATTR:
> -		/* Use the label from the mountpoint. */
> +		/*
> +		 * Use the label from the mountpoint.  Take this opportunity
> +		 * to lazy-instantiate, just for correctness.
> +		 */
>  		mac_update_vnode_from_mount(vp, vp->v_mount);
> -		return (0);
> -
> +		error = mac_externalize(&vp->v_label, &extmac);
> +		if (error)
> +			return (error);
> +		error = vn_extattr_set(vp, IO_NODELOCKED,
> +		    FREEBSD_MAC_EXTATTR_NAMESPACE, FREEBSD_MAC_EXTATTR_NAME,
> +		    sizeof(extmac), (char *)&extmac, curthread);
> +		if (error == 0)
> +			break;
>  	default:
>  		/* Fail horribly. */
>  		return (error);
> @@ -987,8 +996,7 @@
>  		 * about doing this.
>  		 */
>  		mac_update_vnode_from_mount(vp, vp->v_mount);
> -
> -		return (0);
> +		error = 0;
>  	default:
>  		return (error);
>  	}
> @@ -2216,16 +2224,6 @@
>  	    child, &child->v_label);
>  }
>  
> -void
> -mac_create_vnode_from_exported(struct ucred *cred, struct vnode *vp,
> -    struct mac *extmac, struct label *intlabel)
> -{
> -	
> -	ASSERT_VOP_LOCKED(vp, "mac_create_vnode_from_exported");
> -
> -	MAC_PERFORM(create_vnode_from_exported, cred, vp, extmac, intlabel);
> -}
> -
>  int
>  mac_cred_check_statfs(struct ucred *cred, struct mount *mount)
>  {
> 
> ==== //depot/projects/trustedbsd/mac/sys/sys/mac.h#109 (text+ko) ====
> 
> @@ -326,8 +326,6 @@
>  	    struct ucred *cred_child);
>  void	mac_create_vnode_from_vnode(struct ucred *cred, struct vnode *parent,
>  	    struct vnode *child);
> -void	mac_create_vnode_from_exported(struct ucred *cred, struct vnode *vp,
> -	    struct mac *extmac, struct label *intlabel);
>  void	mac_set_socket_peer_from_mbuf(struct mbuf *mbuf,
>  	    struct socket *socket);
>  void	mac_set_socket_peer_from_socket(struct socket *oldsocket,
> 


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?Pine.NEB.3.96L.1020712002618.86266A-100000>