From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 01B66C001DE for ; Fri, 28 Jul 2023 13:04:35 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4RC7Bp3chHz3dWQ for ; Fri, 28 Jul 2023 23:04:34 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=aculab.com (client-ip=185.58.85.151; helo=eu-smtp-delivery-151.mimecast.com; envelope-from=david.laight@aculab.com; receiver=lists.ozlabs.org) Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4RC1QJ0YfZz2ygx for ; Fri, 28 Jul 2023 18:44:06 +1000 (AEST) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-66-QuWuNYGHMBmrzfdm4fjM8A-1; Fri, 28 Jul 2023 09:44:01 +0100 X-MC-Unique: QuWuNYGHMBmrzfdm4fjM8A-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Fri, 28 Jul 2023 09:43:58 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Fri, 28 Jul 2023 09:43:58 +0100 From: David Laight To: 'Aleksa Sarai' , Alexey Gladkov Subject: RE: [PATCH v4 2/5] fs: Add fchmodat2() Thread-Topic: [PATCH v4 2/5] fs: Add fchmodat2() Thread-Index: AQHZwLFLeKGBJJpK+0qJRy2agWp2qK/O266A Date: Fri, 28 Jul 2023 08:43:58 +0000 Message-ID: References: <20230727.041348-imposing.uptake.velvet.nylon-712tDwzCAbCCoSGx@cyphar.com> <20230727.173441-loving.habit.lame.acrobat-V6VTPe8G4FRI@cyphar.com> In-Reply-To: <20230727.173441-loving.habit.lame.acrobat-V6VTPe8G4FRI@cyphar.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Fri, 28 Jul 2023 23:01:37 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "dalias@libc.org" , "linux-ia64@vger.kernel.org" , "fenghua.yu@intel.com" , "alexander.shishkin@linux.intel.com" , "catalin.marinas@arm.com" , Palmer Dabbelt , "x86@kernel.org" , "stefan@agner.ch" , "ldv@altlinux.org" , "dhowells@redhat.com" , "kim.phillips@arm.com" , "paulus@samba.org" , "deepa.kernel@gmail.com" , "hpa@zytor.com" , "sparclinux@vger.kernel.org" , "will@kernel.org" , "linux-arch@vger.kernel.org" , "linux-s390@vger.kernel.org" , "hare@suse.com" , "gor@linux.ibm.com" , "ysato@users.sourceforge.jp" , "deller@gmx.de " , "linux-sh@vger.kernel.org" , "linux@armlinux.org.uk" , "borntraeger@de.ibm.com" , "mingo@redhat.com" , "geert@linux-m68k.org" , "jhogan@kernel.org" , "mattst88@gmail.com" , "linux-mips@vger.kernel.org" , "fweimer@redhat.com" , Arnd Bergmann , "glebfm@altlinux.org" , "tycho@tycho.ws" , "acme@kernel.org" , "linux-m68k@lists.linux-m68k.org" , "bp@alien8.de" , "viro@zeniv.linux.org.uk" , "luto@kernel.org" , "namhyung@kernel.org" , "tglx@linutronix.de" , "christian@brauner.io" , "axboe@kernel.dk" , "James.Bottomley@hansenpartnership.com" < James.Bottomley@hansenpartnership.com>, "monstr@monstr.eu" , "tony.luck@intel.com" , "linux-parisc@vger.kernel.org" , "linux-api@vger.kernel.org" , LKML , "ralf@linux-mips.org" , "peterz@infradead.org" , "linux-alpha@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "ink@jurassic.park.msu.ru" , "linuxppc-dev@lists.ozlabs.org" , "davem@davemloft.net" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" ... > FWIW, I agree with Christian that these behaviours are not ideal (and > I'm working on a series that might allow for these things to be properly > blocked in the future) but there's also the consistency argument -- I > don't think fchownat() is much safer to allow in this way than > fchmodat() and (again) this behaviour is already possible through > procfs. If the 'through procfs' involves readlink("/proc/self/fd/n") and accessing through the returned path then the permission checks are different. Using the returned path requires search permissions on all the directories. This is all fine for xxxat() functions where a real open directory fd is supplied. But other cases definitely need a lot of thought to ensure they don't let programs acquire permissions they aren't supposed to have. =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)