From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 21 09:03:05 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5999106564A; Wed, 21 Jul 2010 09:03:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 365758FC18; Wed, 21 Jul 2010 09:03:04 +0000 (UTC) Received: from c122-106-145-25.carlnfd1.nsw.optusnet.com.au (c122-106-145-25.carlnfd1.nsw.optusnet.com.au [122.106.145.25]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o6L930EU007859 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Jul 2010 19:03:01 +1000 Date: Wed, 21 Jul 2010 19:03:00 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Jaakko Heinonen In-Reply-To: <20100721072225.GA1102@a91-153-117-195.elisa-laajakaista.fi> Message-ID: <20100721185227.N7492@delplex.bde.org> References: <20100721072225.GA1102@a91-153-117-195.elisa-laajakaista.fi> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Mailman-Approved-At: Wed, 21 Jul 2010 11:15:57 +0000 Cc: Garrett Cooper , standards@freebsd.org, hackers@freebsd.org Subject: Re: Chasing down bugs with access(2) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2010 09:03:05 -0000 On Wed, 21 Jul 2010, Jaakko Heinonen wrote: > On 2010-07-20, Garrett Cooper wrote: >> I ran into an issue last night where apparently several apps make >> faulty assumptions w.r.t. whether or not access(2) returns functional >> data when running as a superuser. > >> New implementations are discouraged from returning X_OK unless at >> least one execution permission bit is set. > > See PR kern/125009 (http://www.freebsd.org/cgi/query-pr.cgi?pr=125009). > > Here is the latest version of the vaccess*() patch which also changes > vaccess_acl_nfs4(): > > http://people.freebsd.org/~jh/patches/vaccess-VEXEC.diff > > The patch is not a complete fix however. Not all file systems use > vaccess*() for VEXEC in their VOP_ACCESS() (ZFS confirmed). Thus the > patch doesn't work with ZFS. I looked at the patches in the PR. It seems reasonable to require an X but for VEXEC for all file types except directories, like I think the vaccess() version of your patch does. Keeping the existing behaviour for directories seems necessary. E.g., suppose a user changes all his files and directories to mode 000. It should still be possible for root to search, not to mention back up, all those files and directories, without clobbering any of their metadata (including atimes, but those are a different problem). Bruce