Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4244977imj; Tue, 12 Feb 2019 12:20:29 -0800 (PST) X-Google-Smtp-Source: AHgI3IYKnzcWXV4dvHZpsCXFek6hf5V1bioTavzgMOvORWCmMzT5aHnFgJs0JctYcTAos0x50Rbe X-Received: by 2002:a17:902:29ab:: with SMTP id h40mr5758354plb.238.1550002829048; Tue, 12 Feb 2019 12:20:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550002829; cv=none; d=google.com; s=arc-20160816; b=J3nfGkHPAqLNoEgeNevCm5CKIPxc9ZM27dFexwpXtYUpiIbcsY+eox0z8nemLxE+7T Y5bc/s2Jso0deFODK1jWBVpecUycPaR434/WEce/KDTgmOVT7+yhPoL6k/si4UZVKXhU JCuszoR++G6sbnyIFj5HGCFLO+6MTn4kGpi8vsvtmZ2jRM6kgnQSps5mhxl4BcJrLWrz D8vylr5VM9y8Sq8aXHARubixCAdtDRR7bwtKPECbRvS+2lqdRcSaeNqKTy4UewKVxdQc lctZ9hMu96eUggR6hiEnW1PKo/bwrNfaw7njrE7+/ECPB1KTGCH3yTwJVBr3qK79KRub Ge1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:to:cc:in-reply-to:date:subject :mime-version:message-id:from:dkim-signature; bh=jXIL3RE29PsDPaZGlmdeX+8uicygNALwHWDyev5kLPs=; b=C9Ut5yTau9sMHC6AFPQ6uAL4VsWOgQ6DMv0xdRgklIze25RKNnzSgsulkW/0ylMbeQ T5pCv1MQroT8fE2F9DhdQSEZlHQSs74+7MCGdDyABwv3/NMhPiw9bITeWxPq42Lih78B S+Fpjhkq6ogIdkXA+Zy2ziOLXg6IcjWbCcmLqKIw+fcu3SCWjlRYZ8JW9pXWDMEcWrrc r14LyMzaF0NoqZanvQ93dzIO9cvACk8WsUMP3GjvJ0nce74DUv+6QhOALyp7tJLSH4lH D581DpsQyrbiL6jDHCbNwJYPKLoVxIXcw7xSFl6Bjz9p6hYY1MWXUVw7vl6pgFr6Hx+7 SewQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dilger-ca.20150623.gappssmtp.com header.s=20150623 header.b=bC+zksAw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10si10367684pgh.591.2019.02.12.12.20.13; Tue, 12 Feb 2019 12:20:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@dilger-ca.20150623.gappssmtp.com header.s=20150623 header.b=bC+zksAw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730360AbfBLUSR (ORCPT + 99 others); Tue, 12 Feb 2019 15:18:17 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:32899 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728415AbfBLUSR (ORCPT ); Tue, 12 Feb 2019 15:18:17 -0500 Received: by mail-pf1-f194.google.com with SMTP id c123so6623pfb.0 for ; Tue, 12 Feb 2019 12:18:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dilger-ca.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=jXIL3RE29PsDPaZGlmdeX+8uicygNALwHWDyev5kLPs=; b=bC+zksAw7D2RF8ejW6ImYyx5tBsGCQl57+JYJE7SH8F893K5vf/mHY6Ytl8dNeKI8y LqzZnhM+7BjmzmQOM/gVjY9b0/ptXyS0DSNCPgDYYqYe/GjUTZ1O8IfaqjcDNJC551M5 hMxxkgE3Aql34kU2owDMPdQXtZmIeYBNNKWqS6IuRlzTEZifFsBAQPtMcXp4jrGAO06f de6b49KUZQ5ZtuVvV5Suj2/61EWo9iXm5W7SKViwZibdmdbpxTfzAzbkPUK+Wklp9wub TJ/7Hjjq7C/bQoMBQHsEfzYWPQepLRz19ASLxyWTeQfSmG1+SgtcFeBrxSCT8BiyALde I6MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=jXIL3RE29PsDPaZGlmdeX+8uicygNALwHWDyev5kLPs=; b=ChgitAXlUhQS9uQyVhMAcgUQOh35tpMaQOEN52x09bHYMvjrM89Mdg7gTdkib+tA38 zhxan8IPhptiG/Vwwq2jY0oNBpYY5bOFXPsVQ6/+H/HALz+bDYXpsf9ofag9SD/qHKIQ aZ4MimnYwiGjHoHOrWZOwFE1YRMKI5dxzgAMdBwawb8oV3SoeGIEn1TafU3l8W9gyA4+ UIc6xQ8aXZU4Pf9RvvkADY53pJE9CoRK3tcU36oTzVVGXUg6oRatx7IqjFiozENdzJPu 05aSi+47+HtK9MEV0T2kDlE6leA8O3VPx5YWirzuW0dQXcdlWbyfm0n4cxpOeoYdfsWH 7PjA== X-Gm-Message-State: AHQUAuYxAe8oiUZVXI0DJDKDccm55t4aLSh75hNZDEsTI1GFutrmynZE M5nEA8aHS1saZsZCmdeuiOX3BQ== X-Received: by 2002:a62:4c5:: with SMTP id 188mr5754759pfe.130.1550002696225; Tue, 12 Feb 2019 12:18:16 -0800 (PST) Received: from cabot-wlan.adilger.int (S0106a84e3fe4b223.cg.shawcable.net. [70.77.216.213]) by smtp.gmail.com with ESMTPSA id q28sm26449690pgl.35.2019.02.12.12.18.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 12:18:14 -0800 (PST) From: Andreas Dilger Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_C2E7E05C-2B20-4EA4-8AA7-025ABEE10788"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH 2/4] Expose O_PATHSTATIC to userspace Date: Tue, 12 Feb 2019 13:18:10 -0700 In-Reply-To: <20190212145450.2200-2-demiobenour@gmail.com> Cc: Jeff Layton , "J. Bruce Fields" , Alexander Viro , Arnd Bergmann , linux-fsdevel , open list , linux-arch@vger.kernel.org To: demiobenour@gmail.com References: <20190212145450.2200-1-demiobenour@gmail.com> <20190212145450.2200-2-demiobenour@gmail.com> X-Mailer: Apple Mail (2.3273) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Apple-Mail=_C2E7E05C-2B20-4EA4-8AA7-025ABEE10788 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On Feb 12, 2019, at 7:54 AM, demiobenour@gmail.com wrote: > > From: "Demi M. Obenour" > > This adds the file open flag O_PATHSTATIC, which ensures that symbolic > links are *never* followed, even in path components other than the last. > This is distinct from O_NOFOLLOW, which only prevents symlinks in the > *last* component from being followed. > > This is useful for avoiding race conditions in userspace code that > should expose only a subset of the filesystem to clients. This includes > FTP and SFTP servers, QEMU, and others. > > Currently, O_NOFOLLOW must be set if O_PATHSTATIC is set. Otherwise, > open() fails with -EINVAL. I don't want to bikeshed (discard suggestion if you disagree), but why not name the flag "O_NEVER_FOLLOW" so that users can see it is also related to "O_NOFOLLOW"? Otherwise it seems like they are two completely different things from looking at the names, when in fact they are closely related. Cheers, Andreas --Apple-Mail=_C2E7E05C-2B20-4EA4-8AA7-025ABEE10788 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQIzBAEBCAAdFiEEDb73u6ZejP5ZMprvcqXauRfMH+AFAlxjKgMACgkQcqXauRfM H+D8gQ//e+7SA0vBv61wtMK0lXxO3SfVSJHlv9UYGJ8XiaZh8Ui12qH9UsaiuZki o0b2ChHlUVmgWRHB0wDxQ2L8Iabf/WZ+bzYiRU9DE+VDaDHsZusNmpQKRiafEmDw lOMwc/gvwLColA4Fjl+4CfcSyXURrHCG+pINi+EA+cg8X+qSwMWSvJ/G+39rvJ/Y jP19/zxoQ9hAvyKo0acpA2/a2LvMAJ9eFySYURD27IniButV/e4YwuzOMy55dp74 rlvElPktrVJtJ4Wg2smHM2978OLAO96RKxBi3UlfeppscQ8ABn/mPPgZjBP7N2yD NWUxcNEkB6pRznKx/ItqH21B4DZ3ma2QLDu6Hfb59PWBoY0UK86Q4SILJJ7sioxf eda/pQcmHbj9gefg4IMGjMZ4KK3iuAdDJt/PM/nWzOlu17CD9nEgO61GNUUp04Kd NVFeXTGx3Sy/avISJf++N1mN5LEKzFpbHU1Bc7SeyI61ujuCE4S4FYJ3q2IvJzYL 66cvgaJFJbZ9v3mOq0jimwYTy7cDgJrgFSNEuxzGSx/HaRYBoBTU0DAaBwvmMQxu 2RDK4ulIYA9uuxRATGGtuowlh81SI/qoWhxssATbO6vUaBJuHxp/D0NoN9jwSpex MpZUVppYkHQXh/Q9vpxSZtm9Hy19zICQ1Sg7pU0pv/88bv9/iEM= =Qls+ -----END PGP SIGNATURE----- --Apple-Mail=_C2E7E05C-2B20-4EA4-8AA7-025ABEE10788--