From patchwork Wed Jan 8 17:01:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioanna Alifieraki X-Patchwork-Id: 1219823 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47tFys4lDQz9sPn; Thu, 9 Jan 2020 04:06:45 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1ipEn2-00012P-S5; Wed, 08 Jan 2020 17:06:40 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ipEn0-00012I-IP for kernel-team@lists.ubuntu.com; Wed, 08 Jan 2020 17:06:38 +0000 Received: from mail-wr1-f70.google.com ([209.85.221.70]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ipEi3-00046H-Up for kernel-team@lists.ubuntu.com; Wed, 08 Jan 2020 17:01:32 +0000 Received: by mail-wr1-f70.google.com with SMTP id b13so1658207wrx.22 for ; Wed, 08 Jan 2020 09:01:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=MeC22OkQhQkehSQHpD8Vj5HSlU1y7sotDQ8tzixR4tI=; b=ugf5SwjDriDY606fF8JyBLrRb+W9rlqZQrXORgT7KR9ZqTxAR/6q/AO+tW7Q/Yyrzk +ysKE6DV1FhFd6Zwn40LIoJ3AKb+P55e5h/Dd0ELeq7iyKe9BGW7tAUeshNSZWvssf9A AdGODT39oTG6DzOrX2CocrixZ5XD+x7AnqcxNqR5dNTridILPsINGNtnU93GwCDnG/g1 4caFmIgRD/ppEGTnfsPclqtu7jqwric4q5lzyBQ3QNq2/buqHBAGeuoOisuwcQSPhpm0 gYNr/sLF2AJOE2lsjkA/uUmPzzZoQ28bU9h5CYhuflwLhhJ1rvEAMRi3ILzCosLafqbn MO/Q== X-Gm-Message-State: APjAAAWmsxB2x2sW0PJCUjegkeM6xNv0KdOtyveho85R1CSR778+rzJm gUgnbvtm+FeO+/8CAomi9koBKULQWIVU61peJ45/mMx0vYnuqzQV5QVOwUxkGP9xSOBX5AVbeyJ Cwtd0URZUyfqfcPqBWJiaGD9h7oSm7zN49T7wRA0GQw== X-Received: by 2002:a5d:49c7:: with SMTP id t7mr5522275wrs.369.1578502891341; Wed, 08 Jan 2020 09:01:31 -0800 (PST) X-Google-Smtp-Source: APXvYqymjPmLKdVKkHdIV2jCOHfkns7nkby8euQsJu+pQ8Ki45FqC9tkwqpOWaoTfN3RA15/okkeqw== X-Received: by 2002:a5d:49c7:: with SMTP id t7mr5522246wrs.369.1578502891141; Wed, 08 Jan 2020 09:01:31 -0800 (PST) Received: from localhost ([2a02:587:280b:c400:40bf:cea5:c088:6fe]) by smtp.gmail.com with ESMTPSA id a184sm4623668wmf.29.2020.01.08.09.01.29 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Jan 2020 09:01:30 -0800 (PST) From: Ioanna Alifieraki To: kernel-team@lists.ubuntu.com Subject: [SRU][X/generic][X/aws][PATCH 1/1] Revert "ovl: modify ovl_permission() to do checks on two inodes" Date: Wed, 8 Jan 2020 17:01:26 +0000 Message-Id: <20200108170126.19905-2-ioanna-maria.alifieraki@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200108170126.19905-1-ioanna-maria.alifieraki@canonical.com> References: <20200108170126.19905-1-ioanna-maria.alifieraki@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1851243 This commit breaks r/w access to files. Since fixing it requires many commits to be backported revert it to avoid risk of regressions. For detailed description please look at LP #1851243. This reverts commit c8838e8eb196496e55cf40eed602a906b36ef1cc. Signed-off-by: Ioanna Alifieraki Acked-by: Stefan Bader Acked-by: Connor Kuehl --- fs/overlayfs/inode.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index 060482e349ef..013d27dc6f58 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -9,7 +9,6 @@ #include #include -#include #include #include "overlayfs.h" @@ -92,7 +91,6 @@ int ovl_permission(struct inode *inode, int mask) struct ovl_entry *oe; struct dentry *alias = NULL; struct inode *realinode; - const struct cred *old_cred; struct dentry *realdentry; bool is_upper; int err; @@ -145,18 +143,7 @@ int ovl_permission(struct inode *inode, int mask) goto out_dput; } - /* - * Check overlay inode with the creds of task and underlying inode - * with creds of mounter - */ - err = generic_permission(inode, mask); - if (err) - goto out_dput; - - old_cred = ovl_override_creds(inode->i_sb); err = __inode_permission(realinode, mask); - revert_creds(old_cred); - out_dput: dput(alias); return err;