Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp41887ybe; Wed, 4 Sep 2019 14:46:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxHStZ+uq4EG5M9XgZ/Is8M7OQuw3c39ikG52zWRUitVJcvvvgIFOQKedWtlF5R6qGgA2H X-Received: by 2002:a17:902:b218:: with SMTP id t24mr7754653plr.141.1567633594691; Wed, 04 Sep 2019 14:46:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567633594; cv=none; d=google.com; s=arc-20160816; b=AiaAvEoQI91sGU/BPrD3yzn8lsvrtfZNUOtM68quRRB2GjsY9RNQyV/dmvoJwXuyqg CKbu9oVgGN/OnYCBNF5PFvsrfDFIYPKrzq3CTBktt6lnOHLDlMEIaIT3KmffMC+WALkR XvvGIi4YMfB933NBFVpXzeXgqQsq/EY7SOW3HX8VC7ULkhcKztRl3eorGvJMkqyZk+TI xyuX2QPd24brx2ddFCJH9NPPRFmjIEp2vW1S0PJHVLHs5HseyQ6pjQ6Jpg7qgJNcSUs5 fE8HQVlWm/zVO1MzNU7UN7k0ClQa4OOOC7f2crtPh2+w+ZyMcrY2z31xZ3wBRC+d0YI3 m9xA== 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=afyKDAGEEGBbAV94gj2UOZt2XiwokGAAZY9fEg48q/g=; b=E+E/B0tfSQKx19DqqORzifksiUwlqoYXPltWluzAxqfuzwNY1r5Oe+1adih32YrEZb GpqIPRkbQoXpemofAhartSnZ1W+njgeK0R+ZNEs6oz6saPMUhC2vffYiDNbsnqpBbmkY UKZswkUGnHk+aITLOlreQcMs6rFSJCfNlkMa570IMIK3UuxsTH5n7E0SPeeWFww3hMi2 HCnM66w5YmX/Ld0KwGgwdRUm0UACao1ByQREyyjUBz6kQaks28bk6WriWnbFIRrwoi21 nvZA3hjTMaXioD3AoEywyI9s46Gti8xEUv2EA9ucHpzMkMsd6LmqKSvFAKosDH+0yGE2 w0/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=NaaXzsE0; 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 d7si17637275pgf.377.2019.09.04.14.46.19; Wed, 04 Sep 2019 14:46:34 -0700 (PDT) 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=NaaXzsE0; 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 S1730334AbfIDVpS (ORCPT + 99 others); Wed, 4 Sep 2019 17:45:18 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:37628 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725965AbfIDVpS (ORCPT ); Wed, 4 Sep 2019 17:45:18 -0400 Received: by mail-lj1-f194.google.com with SMTP id t14so246492lji.4 for ; Wed, 04 Sep 2019 14:45:16 -0700 (PDT) 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=afyKDAGEEGBbAV94gj2UOZt2XiwokGAAZY9fEg48q/g=; b=NaaXzsE03/A0aggT0JGsMPgqMPOgw689sbkH2wUyL6Wp3qKaZ1pKjDt9q3nSCqMPah 2e4dX/SHASPLfri+fuLDS7WlObVzMB0uCQ613gb+lr0h/VEtc5FGRP26lR62YK8De+Ct /QjcaW9K7a4FCLT2Siyb/L/tVCZoNkYi2RP38= 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=afyKDAGEEGBbAV94gj2UOZt2XiwokGAAZY9fEg48q/g=; b=IMdju0b+UyxLRqxZm9j55H5qUBzYHxXLTZAd8UXF64NAFEqQvnvyow/XYufFqk9i+x v37ik4IJg9v7W/vV8sa8kzkHsvV5S+s5aFjUHiZIukxFTR3rWGGREkLn/qPY5wOMDRU2 4NtfENJbtqcgYgF3XeGi4/Ew9sjtyt8dEqiCQ0YcAxuNn+Oh8hF4XVaeGbX/Kl/bgEq9 N52m/4nIyedkSCq4zomLFZELn5ATLTn+Ny5vpYFkHR3E1bRxlFuuk2oBGefRTS0X8yjg qeU8Of7jU0KmBGKlfpnDJqIuru6+VrnR3yc6TTwbNzu8jkaplzfE2cjR3Eq4UY9sTHUs DO6Q== X-Gm-Message-State: APjAAAUcZ0Pipf6y/8q/4v0ohRYUP2txRc36RXbRAqkf4fRkNB1DCl4o +0BrX0KUSzwx13ZXNnSp+Nmrcb5+QDY= X-Received: by 2002:a05:651c:292:: with SMTP id b18mr8210270ljo.131.1567633515907; Wed, 04 Sep 2019 14:45:15 -0700 (PDT) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com. [209.85.167.54]) by smtp.gmail.com with ESMTPSA id i21sm17242lfl.44.2019.09.04.14.45.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Sep 2019 14:45:15 -0700 (PDT) Received: by mail-lf1-f54.google.com with SMTP id u13so202255lfm.9 for ; Wed, 04 Sep 2019 14:45:15 -0700 (PDT) X-Received: by 2002:a05:6512:512:: with SMTP id o18mr154625lfb.170.1567633024273; Wed, 04 Sep 2019 14:37:04 -0700 (PDT) MIME-Version: 1.0 References: <20190904201933.10736-1-cyphar@cyphar.com> <20190904201933.10736-11-cyphar@cyphar.com> In-Reply-To: From: Linus Torvalds Date: Wed, 4 Sep 2019 14:36:48 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v12 10/12] namei: aggressively check for nd->root escape on ".." resolution To: Aleksa Sarai Cc: Al Viro , Jeff Layton , "J. Bruce Fields" , Arnd Bergmann , David Howells , Shuah Khan , Shuah Khan , Ingo Molnar , Peter Zijlstra , Christian Brauner , Jann Horn , Kees Cook , Eric Biederman , Andy Lutomirski , Andrew Morton , Alexei Starovoitov , Tycho Andersen , David Drysdale , Chanho Min , Oleg Nesterov , Rasmus Villemoes , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Aleksa Sarai , Linux Containers , alpha , Linux API , linux-arch , Linux ARM , linux-fsdevel , linux-ia64@vger.kernel.org, Linux List Kernel Mailing , "open list:KERNEL SELFTEST FRAMEWORK" , linux-m68k , linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390 , Linux-sh list , linux-xtensa@linux-xtensa.org, sparclinux@vger.kernel.org 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 Wed, Sep 4, 2019 at 2:35 PM Linus Torvalds wrote: > > On Wed, Sep 4, 2019 at 2:09 PM Linus Torvalds > wrote: > > > > So you'd have three stages: > > > > 1) ".." always returns -EXDEV > > > > 2) ".." returns -EXDEV if there was a concurrent rename/mount > > > > 3) ".." returns -EXDEV if there was a concurrent rename/mount and we > > reset the sequence numbers and check if you escaped. > > In fact, I wonder if this should return -EAGAIN instead - to say that > "retrying may work". And here "this" was meant to be "case 2" - I was moving the quoted text around and didn't fix my wording, so now it is ambiguous or implies #3, which would be crazy. Sorry for the confusion, Linus