From patchwork Mon Jun 29 17:19:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Khlebnikov X-Patchwork-Id: 6690411 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 3D846C05AC for ; Mon, 29 Jun 2015 17:19:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C1EC20430 for ; Mon, 29 Jun 2015 17:19:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7F7C620421 for ; Mon, 29 Jun 2015 17:19:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753026AbbF2RTL (ORCPT ); Mon, 29 Jun 2015 13:19:11 -0400 Received: from forward-corp1g.mail.yandex.net ([95.108.253.251]:44474 "EHLO forward-corp1g.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752596AbbF2RTD (ORCPT ); Mon, 29 Jun 2015 13:19:03 -0400 Received: from smtpcorp1m.mail.yandex.net (smtpcorp1m.mail.yandex.net [77.88.61.150]) by forward-corp1g.mail.yandex.net (Yandex) with ESMTP id 1827F3660BD9; Mon, 29 Jun 2015 20:19:01 +0300 (MSK) Received: from smtpcorp1m.mail.yandex.net (localhost [127.0.0.1]) by smtpcorp1m.mail.yandex.net (Yandex) with ESMTP id DD8732CA0341; Mon, 29 Jun 2015 20:19:00 +0300 (MSK) Received: from unknown (unknown [2a02:6b8:0:408:5c4e:c25f:503e:96d8]) by smtpcorp1m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id dGhJKWY5nv-J0X4tBIu; Mon, 29 Jun 2015 20:19:00 +0300 (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1435598340; bh=g5dX449eymdOmz8VyL2PD/AyXOWT9MYIxswzAqJeHrc=; h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References: User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding; b=EerQe+zTbS2KyhN1ts5s5EvuWUvFRT5DdJak9WafsXVXCSzSGzRdCE3EARZ118DgP dLzMVyzma8+PDIcraU7zyRYfNY/ELTAb7FvPCtaG+nXbji7m1W2OBot3IlkcxqN1N9 eF2HlQI88ddLsZ/JeKYh5yVKraTUzEaXBVkcrCQ4= Authentication-Results: smtpcorp1m.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Subject: [PATCH 4/4] ovl: forbid overlayfs on top of overlayfs From: Konstantin Khlebnikov To: linux-fsdevel@vger.kernel.org, Miklos Szeredi , linux-kernel@vger.kernel.org, Alexander Viro , linux-unionfs@vger.kernel.org Cc: linux-security-module@vger.kernel.org Date: Mon, 29 Jun 2015 20:19:00 +0300 Message-ID: <20150629171900.15730.43569.stgit@buzz> In-Reply-To: <20150629171856.15730.58271.stgit@buzz> References: <20150629171856.15730.58271.stgit@buzz> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-7.4 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 Mounting overlayfs using other overlayfs instance as lower or upper layer triggers false-positive lockdep warning about possible locking recursion of ->i_mutex in iterate_dir(). Nesting already limited with FILESYSTEM_MAX_STACK_DEPTH = 2 to prevent kernel stack overflow. Overlayfs supports multiple lower layers thus the same configuration could be constructed without nesting. Signed-off-by: Konstantin Khlebnikov --- fs/overlayfs/super.c | 3 +++ 1 file changed, 3 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index e5db31f78c7d..381af9a5ece9 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -700,10 +700,13 @@ static bool ovl_is_allowed_fs_type(struct dentry *root) /* * We don't support: + * - overlayfs * - automount filesystems * - filesystems with revalidate (FIXME for lower layer) * - filesystems with case insensitive names */ + if (root->d_sb->s_op == &ovl_super_operations) + return false; if (dop && (dop->d_manage || dop->d_automount || dop->d_revalidate || dop->d_weak_revalidate ||