Message ID | 1451930639-94331-13-git-send-email-seth.forshee@canonical.com |
---|---|
State | Not Applicable |
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 77CDC14090A for <incoming@patchwork.ozlabs.org>; Tue, 5 Jan 2016 05:12:03 +1100 (AEDT) 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=Xo+NygLf; 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 1aG9ab-0008Kr-A6; Mon, 04 Jan 2016 18:10:41 +0000 Received: from mail-ig0-x231.google.com ([2607:f8b0:4001:c05::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aG9V5-0000X0-Dp for linux-mtd@lists.infradead.org; Mon, 04 Jan 2016 18:05:22 +0000 Received: by mail-ig0-x231.google.com with SMTP id mv3so218495igc.0 for <linux-mtd@lists.infradead.org>; Mon, 04 Jan 2016 10:04:39 -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=DCvnLT65nycMpsxA09TDRCyuGx9zvoBgy7rP6HVW8qA=; b=Xo+NygLfh07sGK+1zL3caCDT5EU3JtUweaL+9sX5xNdfmDVe0nIuGT9TvcxFXHLLez Qfe4jUk+GrmyoCzRvSM76WKQGfgfKZ21dTiKewHhvObdc1nsa03avy7eW+Xpv07/pYBO Tc8lQEYYjYULuLnwE1cgZX8IQCACvvX/l8WSSZ01SJ1dCqyUW1HrlDMW0dEpMZ5K+C9H 087XsKKQubVQpc+hFmsIIxa7Md8NJW8xbw8XPKSLc8wDDSpWkxFOjP7vjCP6Snxmdez5 8gI4erP8oHHDRcaSKGLPZwiTm8x7P1aGv5NZulcdoqZhjNGJCJvTl5nXFZYryQGoe2S9 8OIg== 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=DCvnLT65nycMpsxA09TDRCyuGx9zvoBgy7rP6HVW8qA=; b=ZbhlgN+xeyfqBtMg8db795YqaWbwyi//fY51vCS2jJ/iBX7Q/rDY/3ugb2J23qjNkO sL2p8zRkAwBA+LIixf3Ja3vtal+O+a9ficjL4WsnHWgMyqFl0Ouvx/k8PINP8yMQFLjx 6Ar0C0+OOjN+0PDEm3WPJvGcquWV4Rd7ghWSvGdN25htp0sE8BUscpcbLDwtCZfby3C4 f6v8tbCo7Entwi/QfGf65i10kwDJkJoluALP11FEhY4GWQZo1qo7oSGmNdIb5EqyVPWy FdjiLMPWnn4C71VwKYhVBNQJQcjdnF1jEeilxMbsFmrDfmF5AKM/hkxv/XI7tCZwRPVS 7qww== X-Gm-Message-State: ALoCoQnwE5B7JgTMwV3rcTUcuo+BrytLyP1K6DhPhZUFbYwqfVuEIVMsVjATQ5F+Y6XOQ2cLki8URES7xcCM7LyaR0dFmVaDIQ== X-Received: by 10.50.78.101 with SMTP id a5mr79159255igx.42.1451930678507; Mon, 04 Jan 2016 10:04:38 -0800 (PST) Received: from localhost ([66.64.121.229]) by smtp.gmail.com with ESMTPSA id 124sm34809637ioz.10.2016.01.04.10.04.37 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 04 Jan 2016 10:04:37 -0800 (PST) From: Seth Forshee <seth.forshee@canonical.com> To: "Eric W. Biederman" <ebiederm@xmission.com>, Alexander Viro <viro@zeniv.linux.org.uk> Subject: [PATCH RESEND v2 12/18] fs: Don't remove suid for CAP_FSETID in s_user_ns Date: Mon, 4 Jan 2016 12:03:51 -0600 Message-Id: <1451930639-94331-13-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1451930639-94331-1-git-send-email-seth.forshee@canonical.com> References: <1451930639-94331-1-git-send-email-seth.forshee@canonical.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160104_100500_457265_0E1C7E1D X-CRM114-Status: UNSURE ( 9.36 ) 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:4001:c05:0:0:0:231 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: Serge Hallyn <serge.hallyn@canonical.com>, Seth Forshee <seth.forshee@canonical.com>, dm-devel@redhat.com, Miklos Szeredi <miklos@szeredi.hu>, Richard Weinberger <richard.weinberger@gmail.com>, linux-security-module@vger.kernel.org, linux-bcache@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 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 01c036fe1950..3e7c74da9304 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1684,7 +1684,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;