Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753148AbdDKSI7 (ORCPT ); Tue, 11 Apr 2017 14:08:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52058 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751995AbdDKSIy (ORCPT ); Tue, 11 Apr 2017 14:08:54 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A30F3C059725 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=eblake@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A30F3C059725 Subject: Re: [PATCH 1/2] vfs: implement fchmodat2() syscall To: Colin Walters , Greg Kurz , viro@zeniv.linux.org.uk References: <148830142269.7103.7429913851447595016.stgit@bahia> <99466bd0-48f2-1594-5392-5e6191d56ffa@redhat.com> <1491933162.45759.941552624.3722F8E8@webmail.messagingengine.com> <02954403-b546-0afe-39c7-23b7b05dece2@redhat.com> <9005445d-2a56-effd-55da-b3bc700c5cf2@redhat.com> Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <32c7aa8f-e881-d85c-6508-fb0e58922a41@redhat.com> Date: Tue, 11 Apr 2017 13:08:52 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <9005445d-2a56-effd-55da-b3bc700c5cf2@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mNd4DKDC9Qacf2GlIIPVEbTVNTlv9s9Qq" X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 11 Apr 2017 18:08:53 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2498 Lines: 64 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mNd4DKDC9Qacf2GlIIPVEbTVNTlv9s9Qq Content-Type: multipart/mixed; boundary="ILf0lQ4W08OFIwuXHXT1GIHpK52XHACMF"; protected-headers="v1" From: Eric Blake To: Colin Walters , Greg Kurz , viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <32c7aa8f-e881-d85c-6508-fb0e58922a41@redhat.com> Subject: Re: [PATCH 1/2] vfs: implement fchmodat2() syscall References: <148830142269.7103.7429913851447595016.stgit@bahia> <99466bd0-48f2-1594-5392-5e6191d56ffa@redhat.com> <1491933162.45759.941552624.3722F8E8@webmail.messagingengine.com> <02954403-b546-0afe-39c7-23b7b05dece2@redhat.com> <9005445d-2a56-effd-55da-b3bc700c5cf2@redhat.com> In-Reply-To: <9005445d-2a56-effd-55da-b3bc700c5cf2@redhat.com> --ILf0lQ4W08OFIwuXHXT1GIHpK52XHACMF Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/11/2017 01:07 PM, Eric Blake wrote: >=20 > But even if using open(O_PATH)/fchmod() works, it is not immediately > obvious whether it can catch all the same cases that chmodat(O_NOFOLLOW= ) Typo; I obviously meant fchmodat(AT_SYMLINK_NOFOLLOW) > would cover, as there are cases where you have permissions to change > mode bits but not open() the file for reading or writing. And even if > it gets rid of a TOCTTOU race, it still is a 2-syscall hit rather than > an atomic single syscall. >=20 --=20 Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org --ILf0lQ4W08OFIwuXHXT1GIHpK52XHACMF-- --mNd4DKDC9Qacf2GlIIPVEbTVNTlv9s9Qq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJY7Ru0AAoJEKeha0olJ0NqUtYH+QFXXu9PC9OBo69uvxlO1v0X 7ePx1EUIKMoknQYNBw6liW1nlzUZ+RY0LnEOfXWpJRXY9Lk9v5UyDlsiMIvL9suS sh2lC4O1zrSNMULgLH/RtBgGSJQTLfNJprPoNtCGPZmTaEjG7Smva1g4q4D7BkmV DRv2wEdXG42Dd37Q2obgEd7XQ+MCBJvH3vnyYs6RydNQnrExCG8rAXUW16R07Jlr dhqJBfI+rBQc5pdNIrmTQKnnQfjDz1bnofIPU35VJkA0ZwML8Iip5sy/yVzvhBqk KZhZJoOsKM3wvgih+Xx/vdMjJSDlcU13UeSxIjV3AV0KtsjyTv69oIUUzr2ICtI= =OrCN -----END PGP SIGNATURE----- --mNd4DKDC9Qacf2GlIIPVEbTVNTlv9s9Qq--