Received: by 10.213.65.68 with SMTP id h4csp504060imn; Fri, 16 Mar 2018 09:45:17 -0700 (PDT) X-Google-Smtp-Source: AG47ELuhrswHlZBxjzI/ATtkadM58jxyuNB9HxyRVUpoMIXfgs9b6lGioU+fr5Rj0M9peo+P1fJn X-Received: by 2002:a17:902:4827:: with SMTP id s36-v6mr2800220pld.269.1521218717446; Fri, 16 Mar 2018 09:45:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521218717; cv=none; d=google.com; s=arc-20160816; b=as74cj3B1gCtndP32RVZ/WyPR4xreFFyR4EtG7oLkNURtSE1Kuuuva+15Vuo2692ea oZ4D067xFiy2f4m+koAMJMB/wLQ+DWyrXIAiFui44rgFWc3ts7E4xMz5w5brTUdeHJD4 faveKyIdGbl6shrCBKBS6H7KoIcyNVRWCtqKTxdurJiGjbupGrs7YaKLMFFYmD/hMbRK zbWMry04NOUtqjH7nrNIaO1fh6UEfaRQm5AxUfEpXxKCCVE3YJhNoSqIxP4XOH/K+eK5 U9FDdtE3ZA29sPDZenvVtyAlpDhaGKFFEWr0Roxe7HWt+71USIE55ZrieKHYlU8zOb4a nt/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Uz6UCUCMVHrky2aMmTpUd1/7de4sESoNCEx9jd4iGAg=; b=nSM08HUin9ULmeXVEdOJOahEZ+feoMTc5l7YO+V5P2HNxHNxpqrAdLkPxf0AdcSuWK Vaa+m3OZ3YpCmuRFJZB60h96OQuGJQQUNz3oSENMwo50H+N4pmsJm3pS2hpi4dvxkfRc tZnKPZA3j9pym9LPp2SpilHb0RQD0z+dhTpaYwaPyPxrIHOyJVih0IsH3/oAWswUuE7w PbKWehEZd6KbuatNuEg9NBLJMLNsIePEUWWeon/NowKJvymqKnJ8UDV4Xm3I4E//Xk/L YM6UALn5rXBME2M9gLObut2QYB9hRTSHWGjmtWIXBIVnaWegOL/QO1pXuvV3D/Y8FzaL ngjA== 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 e23si5668720pfn.228.2018.03.16.09.45.03; Fri, 16 Mar 2018 09:45:17 -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 S934258AbeCPPgP (ORCPT + 99 others); Fri, 16 Mar 2018 11:36:15 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40166 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934217AbeCPPgL (ORCPT ); Fri, 16 Mar 2018 11:36:11 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id EDF711065; Fri, 16 Mar 2018 15:36:10 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ian Kent , "Eric W. Biederman" , Sasha Levin Subject: [PATCH 4.14 053/109] userns: Dont fail follow_automount based on s_user_ns Date: Fri, 16 Mar 2018 16:23:22 +0100 Message-Id: <20180316152332.845764016@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152329.844663293@linuxfoundation.org> References: <20180316152329.844663293@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: "Eric W. Biederman" [ Upstream commit bbc3e471011417598e598707486f5d8814ec9c01 ] 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") Acked-by: Ian Kent Signed-off-by: "Eric W. Biederman" Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/namei.c | 3 --- 1 file changed, 3 deletions(-) --- a/fs/namei.c +++ b/fs/namei.c @@ -1133,9 +1133,6 @@ static int follow_automount(struct path path->dentry->d_inode) return -EISDIR; - 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;