From patchwork Thu Jun 4 13:29:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 6547291 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DAFF39F326 for ; Thu, 4 Jun 2015 13:30:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 01F9A207E6 for ; Thu, 4 Jun 2015 13:30:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A20FE204D9 for ; Thu, 4 Jun 2015 13:30:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753622AbbFDNaq (ORCPT ); Thu, 4 Jun 2015 09:30:46 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:37893 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753377AbbFDNaD (ORCPT ); Thu, 4 Jun 2015 09:30:03 -0400 Received: by wibdt2 with SMTP id dt2so49452299wib.1 for ; Thu, 04 Jun 2015 06:30:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=O9BaK5Ba1xOCfAzcWC3XBwp9qrG8up0CqXph1eZ3IuA=; b=VrEOLNUW1jhjtkB/rinigx9QeS6rgUGxDH1sMO6bhiNHE2egYIff8DENDZY5ddJRUq 83hmnOOXSmUg6q2PnSFrNbvfFunvC1S6Ovwp5GEB6GvS41TSppbRo3+bz+YaGvxLIYAc F01nqyf/jWedpG4KHMfbsS7MonZ20SK3u38kY= 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=O9BaK5Ba1xOCfAzcWC3XBwp9qrG8up0CqXph1eZ3IuA=; b=jRWZqxEGbtLCVOSBWxcdQ1rn+UGZGEgik2Hnrhmd12dySwj6/hL5MkdCJkJF8pwRRN xPS5VpakJ6FbOYVjvDykd2FYguqiR8NZvMz/hNf6wejXwfg5f2SEuNlbFVoE3LnW7pJi cVp5YknvUYvrrXfre6IfE46PrAFK/w8bwbWn4EL1WdproTOsf7JjUyis41LEcJ0TB+Wn joYTaXewYuT82sxNToIayTNp2tn7Xod9xoupVabREdPKtvlmPwt0i7KsypoEmLYI2YOe sCjdGv65UujhqkvLOBxoGGSEKScz8gTBxTMLsvleC73OXyB85JqSAEm+inz6U6DNcYDW oBdA== X-Gm-Message-State: ALoCoQldb7HBivyWDnZwdE/oKg2m2kEVpFC4Lp1NYBE4+EuhwRV0Jh7vgXgPPvL322H51XdiFP8h X-Received: by 10.180.75.8 with SMTP id y8mr7873883wiv.31.1433424601626; Thu, 04 Jun 2015 06:30:01 -0700 (PDT) Received: from tucsk.pomaz.szeredi.hu (pool-dsl-26-0066.externet.hu. [217.173.38.102]) by mx.google.com with ESMTPSA id pd7sm5792736wjb.27.2015.06.04.06.30.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Jun 2015 06:30:00 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: sa-dev@rainbow.by, andre.roth@roche.com Subject: [PATCH 1/2] ovl: don't traverse automount points Date: Thu, 4 Jun 2015 15:29:45 +0200 Message-Id: <1433424586-7771-2-git-send-email-miklos@szeredi.hu> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1433424586-7771-1-git-send-email-miklos@szeredi.hu> References: <1433424586-7771-1-git-send-email-miklos@szeredi.hu> 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,T_DKIM_INVALID,T_RP_MATCHES_RCVD,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 From: Miklos Szeredi NFS and other distributed filesystems may place automount points in the tree. Previoulsy overlayfs refused to mount such filesystems types (based on the existence of the .d_automount callback), even if the actual export didn't have any automount points. It cannot be determined in advance whether the filesystem has automount points or not. The solution is to allow fs with .d_automount but refuse to traverse any automount points encountered. Signed-off-by: Miklos Szeredi --- fs/overlayfs/super.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index bf8537c7f455..de9d2ee68ccf 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -303,6 +303,10 @@ static inline struct dentry *ovl_lookup_real(struct dentry *dir, } else if (!dentry->d_inode) { dput(dentry); dentry = NULL; + } else if (dentry->d_flags & DCACHE_MANAGED_DENTRY) { + dput(dentry); + /* Don't support traversing automounts */ + dentry = ERR_PTR(-EREMOTE); } return dentry; } @@ -700,12 +704,12 @@ static bool ovl_is_allowed_fs_type(struct dentry *root) /* * We don't support: - * - automount filesystems + * - autofs * - filesystems with revalidate (FIXME for lower layer) * - filesystems with case insensitive names */ if (dop && - (dop->d_manage || dop->d_automount || + (dop->d_manage || dop->d_revalidate || dop->d_weak_revalidate || dop->d_compare || dop->d_hash)) { return false;