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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 55265C7618F for ; Sat, 27 Jul 2019 02:28:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 303D1204EC for ; Sat, 27 Jul 2019 02:28:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727624AbfG0C2b (ORCPT ); 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-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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...