Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp766143ybi; Fri, 26 Jul 2019 19:31:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyE5oGw/GIEdmNThaN51X+p1uMKGlbEf39D02EIc8fBjrHxgI25wSVJjf7wIhGpW0Ny0Rml X-Received: by 2002:a65:640d:: with SMTP id a13mr93462718pgv.256.1564194693026; Fri, 26 Jul 2019 19:31:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564194693; cv=none; d=google.com; s=arc-20160816; b=VzHhDbnBrVj/rZ3YQtXXvNqgYiIHalH8QDPKokW+14VEoobvU5jO/AWxU2Z0D4Yg5a uhdkNtsFLfRTXeHj+XMBbmDotjv++pC1b/4FVaSWnUS4ijYa/g4KDmeA6t7ocG7WxbXe +W42svZc4ZwdCfTQRBBWcEdPz5cOR4j641NYL2PZY/2RK249r9Eyjx6dpe9wziN9nqnk tZlIetuS/duGllG5gCoBu45454mbI3jKXqKTDG7415Yzuc0/IqXAacCbYSJIVUQhOLyh rTnjsVg7pwCTVQENlVPrt5zJkFCb8l1R2eAhlAf0IYccrbNvDuxaoYjY9O87IlSFGGQt 0mSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=nYIQeziHDIniv3Tpn4qh4jUA4gj8XTYFz8CbjuDSpgU=; b=WjCkTJAsw+jN+Bw/3jQQ/I4DtvpjyCd6bYFNyuQo+ZF3v/bJ5TCrJ10RCmQ+r6cleo sMhur8X+gjx8df1cRYmvTr+pRI4mARUABmhGtdSpgpwv+hK0DGVQxf5ZRCPgMMXHhuuE Dvs+tzVBIsuAwECwry9WUyjkSqpmo7YSA32YGaAnr3vuCDL5enE/VH7Qvl6xdJRgaePP C9uRjYbDCAosJAKap8IWYGoVM2RXSd75yniPbE0Gwc7rubBtd4C2KQsP67VguYIUEXHW donGtoRZpKnlA+/xZKxuWy0xdkgtbD0/7eARmwbzX+a/2Cd98EP/Hj47nEIHZ0O9u6Jf G4VA== ARC-Authentication-Results: i=1; mx.google.com; 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 u9si5132149pgf.198.2019.07.26.19.31.17; Fri, 26 Jul 2019 19:31:33 -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; 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 S1727733AbfG0C2b (ORCPT + 99 others); Fri, 26 Jul 2019 22:28:31 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:50178 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726757AbfG0C2a (ORCPT ); Fri, 26 Jul 2019 22:28:30 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1hrCRe-00045F-6X; Sat, 27 Jul 2019 02:28:26 +0000 Date: Sat, 27 Jul 2019 03:28:26 +0100 From: Al Viro To: "Eric W. Biederman" Cc: Linus Torvalds , Christian Brauner , Linux List Kernel Mailing , David Howells , Miklos Szeredi , linux-fsdevel , Linux API Subject: Re: Regression in 5.3 for some FS_USERNS_MOUNT (aka user-namespace-mountable) filesystems Message-ID: <20190727022826.GO1131@ZenIV.linux.org.uk> References: <20190726115956.ifj5j4apn3tmwk64@brauner.io> <20190726232220.GM1131@ZenIV.linux.org.uk> <878sskqp7p.fsf@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878sskqp7p.fsf@xmission.com> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 26, 2019 at 07:46:18PM -0500, Eric W. Biederman wrote: > If someone had bothered to actually look at how I was proposing to clean > things up before the new mount api we would already have that. Sigh. > > You should be able to get away with something like this which moves the > checks earlier and makes things clearer. My old patch against the pre > new mount api code. Check your instances of ->permission(); AFAICS in all cases it's (in current terms) return ns_capable(fc->user_ns, CAP_SYS_ADMIN) ? 0 : -EPERM; In principle I like killing FS_USERNS_MOUNT flag, but when a method is always either NULL or exact same function...