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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12CD6C3A5A9 for ; Wed, 4 Sep 2019 21:37:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D9AB520674 for ; Wed, 4 Sep 2019 21:37:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RgD5UIVE"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="NaaXzsE0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9AB520674 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KT4hssliF1bGOUvlswyBOJEP0BzwUoVKchOx0jntvHc=; b=RgD5UIVEVrUh4i R2Rgc+AXM4EUnzcpFmmDQOrDykzcK0ZkBk9dPzwE4mjd8c4ddMI9M638MTAz7JYqubrE1iECH8Cd2 ETloPfcCJgSlqE69OQAQvgaGZC35s1tfzx3Adlrx83ayojtkCXNiZ/pAyDQxSURBIhn7ah/MAVVYv peCaiQy59Gpk+NTSSkbZlZ5QyGlaNo6cOdkfAIL/57+ZukDXzXbIZatzcyn92MnL61919SQN0Zjzt 3SHZV4CmaK1zUCyLMi/n46tRh20iJHrDTViWw0+rykrXuYHoTT+EWQVU0LbG2erzxKjGSPJKjF6TY ei0OF4fRcBbJkYiBs9+A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i5cxn-0007YK-8e; Wed, 04 Sep 2019 21:37:15 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i5cxj-0007Xf-6Q for linux-arm-kernel@lists.infradead.org; Wed, 04 Sep 2019 21:37:12 +0000 Received: by mail-lf1-x142.google.com with SMTP id t8so172600lfc.13 for ; Wed, 04 Sep 2019 14:37:11 -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=sPnDk5QPEGoAiAmTpySq2/twgBagWEvW1AW/G9NY5WuZomW57cPeVwp8U4a2mNujbh 95yTiRtV2teghb/ScOJZ2B5L2ZFSwS6p+y2KdEDl9myqbBFslqCVxUMPB4n4abskdq9m IEwUmtAw9ZEg/HW0k9fFU2Ypfcn0fwX0Fu1wH9W7CPFBUvt00ln6kCQwG9ReTM8ys1mC 0uC1huv+gvJS89AY0ue3rwGG4RuQOAZ1Z3GMgSWAQX0goDJbjHJzeSD0NAkJR8Cew8ED 14Zuh9xkmvsU9KzwxdYaTpB3jcp/OHWcCFFPuyd5tsyBArg5wRdXyuNZtdntAV7wB39J 20uw== X-Gm-Message-State: APjAAAWlnHRExwCLEoLAcg+TXUM+QQBHqECXbmo8LCx2ax/cgYApMtvM RdyCvc69nX+RP/rdDKXY5zJfqD3dvZI= X-Google-Smtp-Source: APXvYqy/LHLlv7sDboT1VmEeWmcPVx0b0NiJqmJIlXl+G6m0IYBWmLR/UBjUtbr6r1JYuyYfWYVyGg== X-Received: by 2002:ac2:5ec8:: with SMTP id d8mr140273lfq.183.1567633029007; Wed, 04 Sep 2019 14:37:09 -0700 (PDT) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com. [209.85.167.49]) by smtp.gmail.com with ESMTPSA id u8sm13407lfb.36.2019.09.04.14.37.05 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Sep 2019 14:37:07 -0700 (PDT) Received: by mail-lf1-f49.google.com with SMTP id d10so229669lfi.0 for ; Wed, 04 Sep 2019 14:37:05 -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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190904_143711_240572_DC718881 X-CRM114-Status: GOOD ( 11.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-ia64@vger.kernel.org, Linux-sh list , Peter Zijlstra , Rasmus Villemoes , Alexei Starovoitov , Linux List Kernel Mailing , David Howells , "open list:KERNEL SELFTEST FRAMEWORK" , sparclinux@vger.kernel.org, Shuah Khan , linux-arch , linux-s390 , Tycho Andersen , Aleksa Sarai , Jiri Olsa , Alexander Shishkin , Ingo Molnar , Linux ARM , linux-mips@vger.kernel.org, linux-xtensa@linux-xtensa.org, Kees Cook , Arnd Bergmann , Jann Horn , linux-m68k , Al Viro , Andy Lutomirski , Shuah Khan , Namhyung Kim , David Drysdale , Christian Brauner , "J. Bruce Fields" , linux-parisc@vger.kernel.org, Linux API , Chanho Min , Jeff Layton , Oleg Nesterov , Eric Biederman , alpha , linux-fsdevel , Andrew Morton , linuxppc-dev@lists.ozlabs.org, Linux Containers Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel