Message ID | 1449523289-144238-9-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 689CF140291 for <incoming@patchwork.ozlabs.org>; Tue, 8 Dec 2015 08:27:04 +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=mHWoYYkY; 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 1a63Gj-0000Gd-Cp; Mon, 07 Dec 2015 21:24:25 +0000 Received: from mail-ig0-x229.google.com ([2607:f8b0:4001:c05::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a63GA-0008Cr-T2 for linux-mtd@lists.infradead.org; Mon, 07 Dec 2015 21:23:52 +0000 Received: by igcmv3 with SMTP id mv3so88067004igc.0 for <linux-mtd@lists.infradead.org>; Mon, 07 Dec 2015 13:23:30 -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=mHWoYYkYi8E/gTj3/iVQzowzcdMfB1fEd00ULkOIxlgHkzM9AwXIegAykPIJRX0KVp YhTkMInAG0FaVXuXe9adjNlKfhqyrgGsWWYuGgbM6/NqUsnzok7dUTtOGOYav328NE4g ytRFcfIxa8H7qVbZWuky3r9odMYz1mlLV8VuOju6+6zkukqDJWILXh7oi2RKXzKiKfRF TM6qrhTT2yuEaHLMMArxuXGUMExVreNs/gV+w2t8CFJtLKGko7LPMZtYGQvGUflre0U1 ycL/0Iz7wIKH3nM7Qy1lTaITkL9ISemn2NTVLEHwUBy2CRtmrpF7T7EDTqLhIL8di77E I2Pw== 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=V8BBWvDRZc391ffuKK2XlnTXACqoFy+lSdMsVDSi8hZ5NWKZrRHUMdc13MjEoZhFmA CFZqPorAvOOekKF9oEES8I+KZGmanBabbCvMP6LXSFCxhX2W89buJ3zn+f7E8Z8tjLU4 seD3peGdyfEf31AHo34up/saHdeB270AxGQxbZsp3V2uiSOeXjz+CpfL3vffy/vOJmCn AT3iVc9+M7/JDmzMBpi8VZFHAbCRtMj93rZN0BlZIMrg5FjjDpaZVchggyFgSxOcgg7x c9Yp9Z19sG2+2tlY2G/PB7QlLjKhpEG386H0DCOOTqFjcIaMwzbn6itwcuJd+DXFvaS0 lR5Q== X-Gm-Message-State: ALoCoQlz1Et4YXzGcDBXr53TRfGpAvj6yGEnsctpa4vfVU79VxRd0QIQl4O+MhIvotwiB4HdlgZ79h1Tzwlxvywi9Rk/S21TjQ== X-Received: by 10.50.155.33 with SMTP id vt1mr499391igb.64.1449523410071; Mon, 07 Dec 2015 13:23:30 -0800 (PST) Received: from localhost (199-87-125-144.dyn.kc.surewest.net. [199.87.125.144]) by smtp.gmail.com with ESMTPSA id l21sm214732ioe.21.2015.12.07.13.23.29 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 07 Dec 2015 13:23:29 -0800 (PST) From: Seth Forshee <seth.forshee@canonical.com> To: "Eric W. Biederman" <ebiederm@xmission.com> Subject: [PATCH v2 08/18] cred: Reject inodes with invalid ids in set_create_file_as() Date: Mon, 7 Dec 2015 15:21:17 -0600 Message-Id: <1449523289-144238-9-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449523289-144238-1-git-send-email-seth.forshee@canonical.com> References: <1449523289-144238-1-git-send-email-seth.forshee@canonical.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151207_132351_231134_CF84937D X-CRM114-Status: UNSURE ( 9.20 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) 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 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, 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);