Message ID | 1461339521-123191-16-git-send-email-seth.forshee@canonical.com |
---|---|
State | Superseded |
Headers | show
Return-Path: <linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qs0Ft3LVyz9t4h for <incoming@patchwork.ozlabs.org>; Sat, 23 Apr 2016 01:41:06 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical-com.20150623.gappssmtp.com header.i=@canonical-com.20150623.gappssmtp.com header.b=bDyTyC9v; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1atdBh-0003Sg-RI; Fri, 22 Apr 2016 15:40:09 +0000 Received: from mail-oi0-x235.google.com ([2607:f8b0:4003:c06::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1atdBG-0001oR-6j for linux-mtd@lists.infradead.org; Fri, 22 Apr 2016 15:39:44 +0000 Received: by mail-oi0-x235.google.com with SMTP id p188so136866228oih.2 for <linux-mtd@lists.infradead.org>; Fri, 22 Apr 2016 08:39:23 -0700 (PDT) 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=aqQyXPJio7EfONch9ctwqz6lN4DeKnNQxNkzABjDaBI=; b=bDyTyC9vY1fxswg6QwYcCgkIBbW/gzQnAoF5zwAp8zwNFEf38y7KuwTOLNf010NE3B wxO/UE+UJ0JHPS8yU16vHIZBaszQxOktOuqy7UAl8Ip154u8ry/yLoaGQ8qUJ+Uq6L5J FSWYXzz1hOFNaVjlkITeEd5awT7SimSp4zWTB1pEMhgViiiuBIu/54+tjtTzHn+Cfxve R+zUzY0WGLAxGxshFwmmocxpYIIJAoVt/u3NPkSVCXNvR2Syf19KM2UYSjwtufLt660h bnnqQx6SxaLVPtVzn8cD5nxKMca9i/hWAxWpPnB1JxlusloY7C8Y+NPoH/efkyMBcMZL W4gg== 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=aqQyXPJio7EfONch9ctwqz6lN4DeKnNQxNkzABjDaBI=; b=AUgKXiIyq2D5mAsfVQ95Uf42UjgIJyW8pMPVKyEEROXEYaf9SHAAy+OPnMw29PGsKj DHtoKPrKNB/U4XJQVpIK7gKh/+e+i4WrvnAGnKtSAGI4czryCaissqNHvGVwU2UGFsHx mI1EOWpImy68H8nke+qJFkqFdLfiF6LYW2lXN9DmN9KK56brJcUJXMSSEPr9zDbQSTpj 1QZMh1J6GNc394PHLz3zV7KymKhCpUkYCGmj2VZqiPDPYSIRU1gRhArFOkt3fZ1XfZnS oDaGWnvthPn9d+3UPB1nsi7U1s4DMxJN1Tv0z8FodfL4OchYlbVRIdkF5lMVmCUC3ZO/ 23Gg== X-Gm-Message-State: AOPr4FUdtaaUM57tXaVcEx3l3Iz3SsAQPUwWYNZKZWv4ZXUOUdMRUqumS31boyswA9PMZqrO X-Received: by 10.202.194.198 with SMTP id s189mr8887842oif.17.1461339563421; Fri, 22 Apr 2016 08:39:23 -0700 (PDT) Received: from localhost ([2605:a601:aab:f920:ad1c:41df:dcb1:a4a0]) by smtp.gmail.com with ESMTPSA id e60sm2083107ote.34.2016.04.22.08.39.22 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 22 Apr 2016 08:39:22 -0700 (PDT) From: Seth Forshee <seth.forshee@canonical.com> To: "Eric W. Biederman" <ebiederm@xmission.com>, Alexander Viro <viro@zeniv.linux.org.uk> Subject: [PATCH v3 15/21] fs: Don't remove suid for CAP_FSETID in s_user_ns Date: Fri, 22 Apr 2016 10:38:32 -0500 Message-Id: <1461339521-123191-16-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461339521-123191-1-git-send-email-seth.forshee@canonical.com> References: <1461339521-123191-1-git-send-email-seth.forshee@canonical.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160422_083942_527444_B66BBC33 X-CRM114-Status: UNSURE ( 8.94 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:4003:c06:0:0:0:235 listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list <linux-mtd.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-mtd>, <mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-mtd/> List-Post: <mailto:linux-mtd@lists.infradead.org> List-Help: <mailto:linux-mtd-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-mtd>, <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe> Cc: linux-bcache@vger.kernel.org, Serge Hallyn <serge.hallyn@canonical.com>, Seth Forshee <seth.forshee@canonical.com>, dm-devel@redhat.com, Miklos Szeredi <mszeredi@redhat.com>, Richard Weinberger <richard.weinberger@gmail.com>, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, fuse-devel@lists.sourceforge.net, Austin S Hemmelgarn <ahferroin7@gmail.com>, linux-mtd@lists.infradead.org, selinux@tycho.nsa.gov, linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org, Pavel Tikhomirov <ptikhomirov@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" <linux-mtd-bounces@lists.infradead.org> Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
diff --git a/fs/inode.c b/fs/inode.c index 69b8b526c194..cd52170f9117 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1690,7 +1690,8 @@ int should_remove_suid(struct dentry *dentry) if (unlikely((mode & S_ISGID) && (mode & S_IXGRP))) kill |= ATTR_KILL_SGID; - if (unlikely(kill && !capable(CAP_FSETID) && S_ISREG(mode))) + if (unlikely(kill && !ns_capable(dentry->d_sb->s_user_ns, CAP_FSETID) && + S_ISREG(mode))) return kill; return 0;