Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp128845pxk; Tue, 15 Sep 2020 23:20:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxS0IyrO0kKJrMrr9Y+aiypbxaJneCU4MqPEapaO565TxTqUREGWFOXPjZGxkAkQVmHntj8 X-Received: by 2002:a50:ed8d:: with SMTP id h13mr25287444edr.50.1600237254313; Tue, 15 Sep 2020 23:20:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600237254; cv=none; d=google.com; s=arc-20160816; b=0gB/F7PE42Pt2sK/5sEMoIvNOqQ8LqqYQyVhnBoSah6FQPMxdZwC45uWbXVP6vTw5T Q2DIehacQcnFWf4uDIz1oXElCS/oDYzGHxaNOYoK8edU08Y1mIb4e79G720g7Z4LaFka yyAChDhUAfdAxirIwgXS1kzFnYYjOFXC2u/2aJmbjiP7C5l4pcM/Fcb4jCeY+My2TJqr myeK1Ld+/crupE8oiNRF2k7P6R4qr6mupV+QbtPWbyN0VpI/Ru0xwg6jld3B+SPr/IhO mITBxKGw/Mx9AFFmkMKXTdduAEzRhJUA2rpjmzVfsA4a7E0VlaKANnBIcYmOcBOdE3Q4 vFjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=H4s3kgd2D6PVWyS8u8yWwXjTwkO12ciMpEOpyk6C1Jg=; b=agT18ByuWZqkxXFVfx5D12+Ys0joyueCV0rxXzyVTkd7vSFNaoOcjP4Q13ie/DIf+X bZsn5c+OFyxvBrPSRnVVEMcOKXpsEu2mgtItU1J8b0kqWQz+Uuj9f4nBv5QFR3ObqcVV q9b19f88d6tZdj6TcmTYtOgYSqATeoLxg7CGO+o7xBtjlLL5llR7GgSPhUUxPaJHIWjG nMOeonIvkvuzDr3JL4FahWLtPNZmmr1j5r4isYgWE59nHPHvKQTCfE7h6oU2OsvY/yys tjIwBbtFuUje7AxxnIW0DTJSDWiq05RHb9qHtcrWhPNNrCJdPle+ahIwcq5TorGLg4ZV 401Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jQ1Y+KMU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 10si5677132ejn.250.2020.09.15.23.20.32; Tue, 15 Sep 2020 23:20:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jQ1Y+KMU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726180AbgIPGTJ (ORCPT + 99 others); Wed, 16 Sep 2020 02:19:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:42958 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726068AbgIPGTJ (ORCPT ); Wed, 16 Sep 2020 02:19:09 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C89A1208E4; Wed, 16 Sep 2020 06:19:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600237148; bh=0XR7vIA8RM07+1wJZFz5+pD+mhjIp38UU8a6XXzcxFo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jQ1Y+KMUi9WYEThAwAH7vPIfn7vzIguRiVkp/5IOiZeQ+d2JhoWp1oOiR03D3xrH4 qlV4K3uaabBYJOS/EsIycmYctgyYyfEs7AeuMjbe3ZaO9RDf+i3+FthO16pj7GwGTE sSMHhpfiVG1MEUagVsfhcRZlF7gaIEJn1M9ogoLM= Date: Wed, 16 Sep 2020 08:19:43 +0200 From: Greg KH To: Rich Felker Cc: linux-api@vger.kernel.org, Alexander Viro , Christoph Hellwig , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] vfs: add fchmodat2 syscall Message-ID: <20200916061943.GC142621@kroah.com> References: <20200916002157.GO3265@brightrain.aerifal.cx> <20200916002335.GQ3265@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200916002335.GQ3265@brightrain.aerifal.cx> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 15, 2020 at 08:23:38PM -0400, Rich Felker wrote: > POSIX defines fchmodat as having a 4th argument, flags, that can be > AT_SYMLINK_NOFOLLOW. Support for changing the access mode of symbolic > links is optional (EOPNOTSUPP allowed if not supported), but this flag > is important even on systems where symlinks do not have access modes, > since it's the only way to safely change the mode of a file which > might be asynchronously replaced with a symbolic link, without a race > condition whereby the link target is changed. > > It's possible to emulate AT_SYMLINK_NOFOLLOW in userspace, and both > musl libc and glibc do this, by opening an O_PATH file descriptor and > performing chmod on the corresponding magic symlink in /proc/self/fd. > However, this requires procfs to be mounted and accessible. > > Signed-off-by: Rich Felker No kselftest for this new system call, or man page? How do we know this actually works and what the expected outcome should be? thanks, greg k-h