Message ID | 87y3moiqc9.fsf@xmission.com |
---|---|
State | New |
Series | "userns: automount cleanups" |
Headers | show
Delivered-To: criupatchwork@gmail.com Received: from gmail-imap.l.google.com [64.233.165.109] by patchwork.criu.org with IMAP (fetchmail-6.3.26) for <root@localhost> (single-drop); Thu, 30 Nov 2017 01:05:14 +0100 (CET) Received: by 10.100.247.130 with SMTP id v2csp170776pjk; Wed, 29 Nov 2017 16:05:11 -0800 (PST) X-Google-Smtp-Source: AGs4zMbv1uCFfMf/jW7od8RWaNbMfhnxIsuzhw4QJafW1d/9Ozr/94JLqurM/Lcv6b6OpJyItu0U X-Received: by 10.223.193.135 with SMTP id x7mr418274wre.211.1512000311159; Wed, 29 Nov 2017 16:05:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512000311; cv=none; d=google.com; s=arc-20160816; b=eJdYNEN/0IpLt8EFJdOlgGN96jAZ73+34TrULePEWrJbY0g9x6CD6AgoodhlYaJFQW 0I2yxvG5UNunS7MIjdFrUSDBCk150+fUFbRpSobjC7sFFeSD8oKLzrXE2Lm2H2nsZyVJ eXLSKK/eQI8m1I5e43v+kOm3jOBG5k+BFEfFD7KFpI0NZzEauHNgamoiRcgqhgw/lnqg GV6JgWUnPnBQKDr/IsoUnO/VzcwAob85WavxXp/OlKxOtLIkoVF+EAT/mZ2ULFkuX00p xfemLq2sg1JrIfexhxlSn7v4ZGQGtiK9z1sdlwYifW1Qh6FSuj6dJk/3JK4uTDJK+8fJ 05mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:cc :subject:mime-version:user-agent:message-id:in-reply-to:date :references:to:from:delivered-to:arc-authentication-results; bh=aTpVBEapf7z229vh9dzLSskBs2L4IKU09ZlgmHBnkgU=; b=VcwwAPRh+kYAilFr4/4hQCh4+IrRPhinLF1OO2jU6PabJUUOcwHksy2lcizmkVnAdu WJ3kgW7fsZzx0brLYKQDU6AucGLWf5Q1JgJW8+mXv/z3bwEuTZV2ABv3Mk6gQ49MzxpP 8/GdmDksrVsEq3m4NwM/F0uSzdYyu2WQGvXCprhi+ebxxXdWYnahhjTJPdebDjEF93Fg CCajfmuY9Uy51BqLp43zQ/y4xF8qYDbS//reRd/elR8oKOrB4BV+zCcK+9aU5g1TzKBL +hHoFO0gQKb5ofsT/JA9ML/iJHclapClhcQHoCcQGI7w7Ucx/FUCPIp6hi9y5n3MlTat OUHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of containers-bounces@lists.linux-foundation.org designates 140.211.169.12 as permitted sender) smtp.mailfrom=containers-bounces@lists.linux-foundation.org Return-Path: <containers-bounces@lists.linux-foundation.org> Received: from mail.linuxfoundation.org (mail.linuxfoundation.org. [140.211.169.12]) by mx.google.com with ESMTPS id c202si2481233wmc.113.2017.11.29.16.05.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 16:05:11 -0800 (PST) Received-SPF: pass (google.com: domain of containers-bounces@lists.linux-foundation.org designates 140.211.169.12 as permitted sender) client-ip=140.211.169.12; Authentication-Results: mx.google.com; spf=pass (google.com: domain of containers-bounces@lists.linux-foundation.org designates 140.211.169.12 as permitted sender) smtp.mailfrom=containers-bounces@lists.linux-foundation.org Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id B8911C48; Thu, 30 Nov 2017 00:05:08 +0000 (UTC) X-Original-To: containers@lists.linux-foundation.org Delivered-To: containers@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 9ADD9BC8 for <containers@lists.linux-foundation.org>; Thu, 30 Nov 2017 00:05:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from out03.mta.xmission.com (out03.mta.xmission.com [166.70.13.233]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A12A61B4 for <containers@lists.linux-foundation.org>; Thu, 30 Nov 2017 00:05:06 +0000 (UTC) Received: from in02.mta.xmission.com ([166.70.13.52]) by out03.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from <ebiederm@xmission.com>) id 1eKCLh-0004qh-LR; Wed, 29 Nov 2017 17:05:05 -0700 Received: from 67-3-248-7.omah.qwest.net ([67.3.248.7] helo=x220.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from <ebiederm@xmission.com>) id 1eKCLb-0001KK-Om; Wed, 29 Nov 2017 17:05:05 -0700 From: ebiederm@xmission.com (Eric W. Biederman) To: Linux Containers <containers@lists.linux-foundation.org> References: <874lpck52r.fsf@xmission.com> Date: Wed, 29 Nov 2017 18:04:54 -0600 In-Reply-To: <874lpck52r.fsf@xmission.com> (Eric W. Biederman's message of "Wed, 29 Nov 2017 18:01:16 -0600") Message-ID: <87y3moiqc9.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 X-XM-SPF: eid=1eKCLb-0001KK-Om; ; ; mid=<87y3moiqc9.fsf@xmission.com>; ; ; hst=in02.mta.xmission.com; ; ; ip=67.3.248.7; ; ; frm=ebiederm@xmission.com; ; ; spf=neutral X-XM-AID: U2FsdGVkX19IbtNwph0JIT8wIGN4z1SwVfNgYiJ75yg= X-SA-Exim-Connect-IP: 67.3.248.7 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-DCC: XMission; sa01 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Linux Containers <containers@lists.linux-foundation.org> X-Spam-Relay-Country: X-Spam-Timing: total 5557 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 3.3 (0.1%), b_tie_ro: 2.2 (0.0%), parse: 1.26 (0.0%), extract_message_metadata: 26 (0.5%), get_uri_detail_list: 2.0 (0.0%), tests_pri_-1000: 10 (0.2%), tests_pri_-950: 2.1 (0.0%), tests_pri_-900: 1.61 (0.0%), tests_pri_-400: 28 (0.5%), check_bayes: 26 (0.5%), b_tokenize: 10 (0.2%), b_tok_get_all: 7 (0.1%), b_comp_prob: 3.9 (0.1%), b_tok_touch_all: 2.6 (0.0%), b_finish: 0.82 (0.0%), tests_pri_0: 412 (7.4%), check_dkim_signature: 0.89 (0.0%), check_dkim_adsp: 5 (0.1%), tests_pri_500: 5068 (91.2%), poll_dns_idle: 5060 (91.0%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH 1/2] userns: Don't fail follow_automount based on s_user_ns X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Cc: linux-fsdevel@vger.kernel.org, Miklos Szeredi <mszeredi@redhat.com>, Seth Forshee <seth.forshee@canonical.com>, linux-kernel@vger.kernel.org, Ian Kent <raven@themaw.net> X-BeenThere: containers@lists.linux-foundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux Containers <containers.lists.linux-foundation.org> List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/containers>, <mailto:containers-request@lists.linux-foundation.org?subject=unsubscribe> List-Archive: <http://lists.linuxfoundation.org/pipermail/containers/> List-Post: <mailto:containers@lists.linux-foundation.org> List-Help: <mailto:containers-request@lists.linux-foundation.org?subject=help> List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/containers>, <mailto:containers-request@lists.linux-foundation.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: containers-bounces@lists.linux-foundation.org Errors-To: containers-bounces@lists.linux-foundation.org |
diff --git a/fs/namei.c b/fs/namei.c index f0c7a7b9b6ca..f47118ed36e7 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1142,9 +1142,6 @@ static int follow_automount(struct path *path, struct nameidata *nd, return -ENOENT; } - if (path->dentry->d_sb->s_user_ns != &init_user_ns) - return -EACCES; - nd->total_link_count++; if (nd->total_link_count >= 40) return -ELOOP;
When vfs_submount was added the test to limit automounts from filesystems that with s_user_ns != &init_user_ns accidentially left in follow_automount. The test was never about any security concerns and was always about how do we implement this for filesystems whose s_user_ns != &init_user_ns. At the moment this check makes no difference as there are no filesystems that both set FS_USERNS_MOUNT and implement d_automount. Remove this check now while I am thinking about it so there will not be odd booby traps for someone who does want to make this combination work. vfs_submount still needs improvements to allow this combination to work, and vfs_submount contains a check that presents a warning. The autofs4 filesystem could be modified to set FS_USERNS_MOUNT and it would need not work on this code path, as userspace performs the mounts. Fixes: 93faccbbfa95 ("fs: Better permission checking for submounts") Fixes: aeaa4a79ff6a ("fs: Call d_automount with the filesystems creds") Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> --- fs/namei.c | 3 --- 1 file changed, 3 deletions(-)