From patchwork Wed Mar 9 15:18:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 8546971 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1763BC0553 for ; Wed, 9 Mar 2016 15:18:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 326972013A for ; Wed, 9 Mar 2016 15:18:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3954B20114 for ; Wed, 9 Mar 2016 15:18:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933044AbcCIPSl (ORCPT ); Wed, 9 Mar 2016 10:18:41 -0500 Received: from mail-ob0-f174.google.com ([209.85.214.174]:32945 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932921AbcCIPSS (ORCPT ); Wed, 9 Mar 2016 10:18:18 -0500 Received: by mail-ob0-f174.google.com with SMTP id fz5so49832920obc.0 for ; Wed, 09 Mar 2016 07:18:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=75vhZodEno1dkhYSRk4p3bFZ4XyinrACV9ZEEE99PKc=; b=umuZSfzi5ZsouvwJc4QCQtd6tiocs8T7jtejk440LwGrvGQipoPJDCvyoLT//HKXpE IpDLG3hqTtsDXtOH74x/faMxI1ZKzWadwJzS2B74DCYl1EHvRcC9MDJmqUTUSPem4GDo 2/DRrLpoFgVMM9GYFqZ3TfZEpvcq8bbbRPw/s5CRLjZyM6rl91An3jB46r31Umedprex g5pLTvZES/nVzeWq5BQ0DQAkdeVj91GJgXtwfBPDlpxxwoTb+zruO2QoJ3P1KicJGFnD pQnGt0PWgvsDYI9GVvb+7fdw9XQ4iYojdaIJys7bQLbot4pE6tpC+eQIbkM8+nPLs/5j 6YTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=75vhZodEno1dkhYSRk4p3bFZ4XyinrACV9ZEEE99PKc=; b=ZewaNFSewssg3Mna0DJ5z84RouqUsBfOjfBlY6+5v8B6AJN2ylx5OezEbPqtoMIJL3 cYv6YLeoRZKAUhAra8d0EXdKntPgOB0nEISvcd2NYh/x/fGQtqKWM8OQ5nkjaYm7HiWh Rhzd+D8yqCSs0VuaC447vFq1PpbsOWHVL2L3+CB0PECGIH3uCRFbvIgTflmlgO2dRn88 o4Fxacx+Fpg7UVETxvJ8KUJJuR4pANTrOretaYtt+YAhaXaJZwafkxOvQAzY4t+bf6BW IrxpqVHBYd0669hcqoPlCMRnJ+dxFykETcDJ41E6imk+jf90ZsZ7Popp/L4TBoEOrWep 1laA== X-Gm-Message-State: AD7BkJK9jPfY7lg6ymArvl0xyEeRQbPluEZphhS20lCpC+LB/Uni1qQKLTFXbqMyKOWUclw2 X-Received: by 10.60.35.201 with SMTP id k9mr22639642oej.3.1457536697673; Wed, 09 Mar 2016 07:18:17 -0800 (PST) Received: from localhost ([2605:a601:aaa:d620:69ce:5c46:41e8:aaed]) by smtp.gmail.com with ESMTPSA id s63sm3622237oig.29.2016.03.09.07.18.17 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 09 Mar 2016 07:18:17 -0800 (PST) From: Seth Forshee To: "Eric W. Biederman" , Greg Kroah-Hartman Cc: "Serge E. Hallyn" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Seth Forshee Subject: [PATCH 2/2] debugfs: Make automount point inodes permanently empty Date: Wed, 9 Mar 2016 09:18:07 -0600 Message-Id: <1457536687-32794-3-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1457536687-32794-1-git-send-email-seth.forshee@canonical.com> References: <1457536687-32794-1-git-send-email-seth.forshee@canonical.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Starting with 4.1 the tracing subsystem has its own filesystem which is automounted in the tracing subdirectory of debugfs. Prior to this debugfs could be bind mounted in a cloned mount namespace, but if tracefs has been mounted under debugfs this now fails because there is a locked child mount. This creates a regression for container software which bind mounts debugfs to satisfy the assumption of some userspace software. In other pseudo filesystems such as proc and sysfs we're already creating mountpoints like this in such a way that no dirents can be created in the directories, allowing them to be exceptions to some MNT_LOCKED tests. In fact we're already do this for the tracefs mountpoint in sysfs. Do the same in debugfs_create_automount(), since the intention here is clearly to create a mountpoint. This fixes the regression, as locked child mounts on permanently empty directories do not cause a bind mount to fail. Cc: stable@vger.kernel.org # v4.1+ Signed-off-by: Seth Forshee Acked-by: Serge Hallyn --- fs/debugfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index bece948b363d..8580831ed237 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -457,7 +457,7 @@ struct dentry *debugfs_create_automount(const char *name, if (unlikely(!inode)) return failed_creating(dentry); - inode->i_mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO; + make_empty_dir_inode(inode); inode->i_flags |= S_AUTOMOUNT; inode->i_private = data; dentry->d_fsdata = (void *)f;