Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp245920ybl; Thu, 9 Jan 2020 21:04:40 -0800 (PST) X-Google-Smtp-Source: APXvYqw0Kn/OEIsomJCasjguVIJ9memgA0xcHDq5qe9RN/c2Ckgp7ToGNFGjFcOLjC7ERhQJ/UNH X-Received: by 2002:aca:1e0f:: with SMTP id m15mr883411oic.58.1578632680800; Thu, 09 Jan 2020 21:04:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578632680; cv=none; d=google.com; s=arc-20160816; b=D1FiQA00NWXZt3b6cWjjUo9pK8cN08/To8TYczzE3y01uwITDu40sGBIEZUursXPTj FCfaXAHd4kdT+VtI6rG1RF5PfYDq75qaasr8AqyvpHcXFndLHfizl/cKcEx5XVEHQ50R 75VzG83fH4me13FPA9LyGt3/IF4dXwPoxWlbv7r30KBzfBTlOE7m6G8W1lGQB0VNXcNI /kvzc4SPZfKDdqul4yBJqgzarawJFpMYZVAM+AtoWdWPE/dMh47jmpW5YMynR67MmA/f 7SrBIYdIq999/AA6rlx9wTx9UvnlVc2Gem6XXZ2+4TPcug76MqiC8sM2ebzmF3owmpFe QeWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=B/GI7mSLrO7+AWyztv1F/7+LjmBRdi9pxniW8srHraM=; b=IqWrVeMlu5i0whbCdRKwKAAz/CRUhGUCm6WWSjPmXVNb9TnOZ+Y/QvUuAz0/qdrMa3 u0wRi2AwrQ5R1x9hlnqZ1/KTVKXLQmP/FGvsK2CBjrCaLzJWCdgxK8X7wTWupT1ZWKNa j0oaSHnWWd8MgkZKYvzQElJPdMeqTt9/P2++Eykew2OQc1ujCaeLvVH3hN05R10r86zc qs0GxUrDPjnzG4g6IG46bEhT1F0GnCkTjlFtfy/wP6vO2kXrJVfKIYmKRi52gX7Xptxz b1lk4wHT8u11Im3s+PoY1AEQYoS+Zab162JuYTCbBGPt4znPO2fWr329+DEGOF+BNBJT 9beQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=WJnSkgb5; 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 p7si522904ota.299.2020.01.09.21.04.29; Thu, 09 Jan 2020 21:04:40 -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=@linux-foundation.org header.s=google header.b=WJnSkgb5; 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 S1726034AbgAJFDY (ORCPT + 99 others); Fri, 10 Jan 2020 00:03:24 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:43435 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725822AbgAJFDX (ORCPT ); Fri, 10 Jan 2020 00:03:23 -0500 Received: by mail-lj1-f196.google.com with SMTP id a13so728670ljm.10 for ; Thu, 09 Jan 2020 21:03:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=B/GI7mSLrO7+AWyztv1F/7+LjmBRdi9pxniW8srHraM=; b=WJnSkgb5IoN+QFM9zDo/+1LUciNYCKC1uNr4+jda+SHQ4Al4kAzM40Ki7rykrkdSQb LRo6BkP+xKhXKun/nrSizTl2SLNY7SO9HFhXKlKAOnq3AXpHt/oUN004/3so/HMeBcSV czfR5SnYRegkSqQWTz+TDMXgEHM9RAu7JIN+Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=B/GI7mSLrO7+AWyztv1F/7+LjmBRdi9pxniW8srHraM=; b=hI8FnIRKmJm3rqK768Dj6A3XkPE+m9TBvQWKfePuqDYiWJ+p1h7/IFjYgWHvAbzEOI V7OR0x7Z8vsgHeQVlnCnxKTbKs2gz2o++o6eowQqUtkXLxkFwsz75nx/LShMliDSSjn5 OwtX+w0DIP8kTNXCHv8FenplmHWIinZRt2E/dPZfcvVr+dN1vNyb/f3YUZbdoWV4K8Mv VOfKZocW4uDgeR1w6vbnaOhzuFujAtwHxoLfB+TzwTutpFwJ705oDfdJcEj+cb7+5o+y 4n9CTIsECD/s0v4uJcqQP71QWTkuEInRYhGXSF4JmU+OC2ubV2frANJpuwxdGkumDVVf 8lyw== X-Gm-Message-State: APjAAAVrCso2VgnbS5juacXQvbaYuJUd/zMJy/UkjLIY7N0DQmUu8kVB 2wzU4Xr24jViUn2obfRLaHNJ3uPQlgU= X-Received: by 2002:a2e:8152:: with SMTP id t18mr1165242ljg.255.1578632600358; Thu, 09 Jan 2020 21:03:20 -0800 (PST) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com. [209.85.167.49]) by smtp.gmail.com with ESMTPSA id k1sm340021lji.43.2020.01.09.21.03.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Jan 2020 21:03:18 -0800 (PST) Received: by mail-lf1-f49.google.com with SMTP id v201so457974lfa.11 for ; Thu, 09 Jan 2020 21:03:17 -0800 (PST) X-Received: by 2002:a05:6512:1dd:: with SMTP id f29mr961529lfp.106.1578632597317; Thu, 09 Jan 2020 21:03:17 -0800 (PST) MIME-Version: 1.0 References: <20200101005446.GH4203@ZenIV.linux.org.uk> <20200101030815.GA17593@ZenIV.linux.org.uk> <20200101144407.ugjwzk7zxrucaa6a@yavin.dot.cyphar.com> <20200101234009.GB8904@ZenIV.linux.org.uk> <20200102035920.dsycgxnb6ba2jhz2@yavin.dot.cyphar.com> <20200103014901.GC8904@ZenIV.linux.org.uk> <20200108031314.GE8904@ZenIV.linux.org.uk> <20200108213444.GF8904@ZenIV.linux.org.uk> <20200110041523.GK8904@ZenIV.linux.org.uk> In-Reply-To: <20200110041523.GK8904@ZenIV.linux.org.uk> From: Linus Torvalds Date: Thu, 9 Jan 2020 21:03:00 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC 0/1] mount: universally disallow mounting over symlinks To: Al Viro Cc: Aleksa Sarai , David Howells , Eric Biederman , stable , Christian Brauner , Serge Hallyn , dev@opencontainers.org, Linux Containers , Linux API , linux-fsdevel , Linux Kernel Mailing List , Ian Kent Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 9, 2020 at 8:15 PM Al Viro wrote: > > > > Hmm. If that's the case, maybe they should be marked implicitly as > > O_PATH when opened? > > I thought you wanted O_PATH as starting point to have mounts traversed? > Confused... No, I'm confused. I meant "non-O_PATH", just got the rules reversed in my mind. So cwd/root would always act as it non-O_PATH, and only using an actual fd would look at the O_PATH flag, and if it was set would walk the mountpoints. > Right, he simply transcribes v7 iget(). > > So I suspect that you are right - your variant of iget was pretty much > one-to-one implementation of Bach's description of v7 iget. Ok, that makes sense. My copy of Bach literally had the system call list "marked off" when I implemented them back when. I may still have that paperbook copy somewhere. I don't _think_ I'd have thrown it out, it has sentimental value. > > I think that in a perfect world, the O_PATH'ness of '42' would be the > > deciding factor. Wouldn't those be the best and most consistent > > semantics? > > > > And then 'cwd'/'root' always have the O_PATH behavior. > > See above - unless I'm misparsing you, you wanted mount traversals in the > starting point if it's ...at() with O_PATH fd. .. and see above, it was just my confusion about the sense of O_PATH. > For cwd and root the situation is opposite - we do NOT traverse mounts > for those. And that's really too late to change. Oh, absolutely. [ snip some more about your automount digging. Looks about right, but I'm not going to make a peep after getting O_PATH reversed ;) ] Linus