Message ID | 1451930639-94331-9-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 781BD140BC1 for <incoming@patchwork.ozlabs.org>; Tue, 5 Jan 2016 05:22:46 +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=pK/XBCgu; 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 1aG9kZ-0000Cd-4i; Mon, 04 Jan 2016 18:20:59 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aG9kU-0008Da-Ir for linux-mtd@bombadil.infradead.org; Mon, 04 Jan 2016 18:20:54 +0000 Received: from mail-ig0-x22a.google.com ([2607:f8b0:4001:c05::22a]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aG9Uy-00011I-AL for linux-mtd@lists.infradead.org; Mon, 04 Jan 2016 18:04:52 +0000 Received: by mail-ig0-x22a.google.com with SMTP id ik10so188520igb.1 for <linux-mtd@lists.infradead.org>; Mon, 04 Jan 2016 10:04:25 -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=lNMozmbm7pfdxKvWpPZNWPjG7CuFlV9btFcGtcgM/0U=; b=pK/XBCguYZ8eemrHygcQb6hiUJR9t5LBmi7/cluKbd8rSJfMW8dkdkTwSTfBBb5YTD GVyPIz0os1x/UCPCugQQtamunieJdAY9SV919m2LwgKm3VQJuSpp1jrATUWyH7GXbSoY ajvT6wP61e/ncMRoUe8FR12oEnBYDKCMubyK0I2pmoyVei0VB5RGohVTOVfB30DJC0oh o6i4hyJIMjNnVfbRTrnxHfCPBTG9X7lCtDJM7pKkS3Bg3150oOdD0ycVhGT9+iiD25bk Bjx6s2fb6VCthYRxdDUdt+ipZLmFsmDJqDFhNUiXWysI1S0lXvbgmssOM11XzcNJT3Vs jcSg== 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=lNMozmbm7pfdxKvWpPZNWPjG7CuFlV9btFcGtcgM/0U=; b=i6P/Bx5LpaC1Lm54Njo+T9dUdRbEpmrpquNGfx6LONRBi8QinK1730G5z4j7kREwvW qkYU01Lvcl1qtBVm/+2PupweByoaiTfkAwep6vUJbV4+wtuqin76JgwR4rS7kUPPZcK1 gxcPtmT7I/44nAHUWxLCKJS4H5VqFKpOq97zNVOx0fEriTKqNF14fbmscpbo7Sr2s/hU OgeBFpdW0pHqKb+vBCbj76XHRlyOJhigKwYrRKC1yOhdTemkHiOg/ZSezZHFvy4FoA/q i23+ns6wYKWTMsHRaHJBG40JjdXNr1lmMwI7vAn3T31tG2Z0XZcAAZ/ZKYXWUjLp5i6U fxbQ== X-Gm-Message-State: ALoCoQl7sBHgMDM7HQ+Q0QLmnXV9d/fhinzKshcBdRLVWeYQzxFKvNn+y4iyNZSCeaQDXj5Uz02PPIE+ZRq8olzjOXjncQ2dgg== X-Received: by 10.50.60.100 with SMTP id g4mr29066157igr.78.1451930664281; Mon, 04 Jan 2016 10:04:24 -0800 (PST) Received: from localhost ([66.64.121.229]) by smtp.gmail.com with ESMTPSA id qr1sm30611540igb.21.2016.01.04.10.04.23 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 04 Jan 2016 10:04:23 -0800 (PST) From: Seth Forshee <seth.forshee@canonical.com> To: "Eric W. Biederman" <ebiederm@xmission.com> Subject: [PATCH RESEND v2 08/18] cred: Reject inodes with invalid ids in set_create_file_as() Date: Mon, 4 Jan 2016 12:03:47 -0600 Message-Id: <1451930639-94331-9-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_180452_487313_BD396DE8 X-CRM114-Status: GOOD ( 11.52 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on casper.infradead.org summary: Content analysis details: (-2.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -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 -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:4001:c05:0:0:0:22a listed in] [list.dnswl.org] 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 <miklos@szeredi.hu>, 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, Alexander Viro <viro@zeniv.linux.org.uk>, 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/kernel/cred.c b/kernel/cred.c index 71179a09c1d6..ff8606f77d90 100644 --- a/kernel/cred.c +++ b/kernel/cred.c @@ -689,6 +689,8 @@ EXPORT_SYMBOL(set_security_override_from_ctx); */ int set_create_files_as(struct cred *new, struct inode *inode) { + if (!uid_valid(inode->i_uid) || !gid_valid(inode->i_gid)) + return -EINVAL; new->fsuid = inode->i_uid; new->fsgid = inode->i_gid; return security_kernel_create_files_as(new, inode);