Message ID | 1425119009-28634-3-git-send-email-computersforpeace@gmail.com |
---|---|
State | Accepted |
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-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41D72140111 for <incoming@patchwork.ozlabs.org>; Sat, 28 Feb 2015 21:30:06 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=zx5m5yET; dkim-adsp=none (unprotected policy); 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 1YRee6-00080i-D2; Sat, 28 Feb 2015 10:29:18 +0000 Received: from mail-pa0-x22d.google.com ([2607:f8b0:400e:c03::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YRedt-0007pm-ER for linux-mtd@lists.infradead.org; Sat, 28 Feb 2015 10:29:05 +0000 Received: by pablf10 with SMTP id lf10so29309529pab.12 for <linux-mtd@lists.infradead.org>; Sat, 28 Feb 2015 02:28:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gRQvndt5r3yMNsbWzJEpc82FD5T/hQcSojvvVL7fUdM=; b=zx5m5yEThcIlr2hCIjs/IqVCN6Yg3Fta5KXdRTe7yA13Jyjih0UkXl1w69W6Ww00rZ riiuqmucmtn/f6Y4jH5R+1OeUW3aMQPKnczBnItnCwZWM0iu9g7lnBFh0PEgIWWc4/p3 aJSdzo0TeIIGHTH0gVK4j/rU7R2z85Swp2l/I5SaShcRUyqZoOWIw4IVqwxto+eTYPKh Tzv23u/wiN8J1D4DO08Kgk8k6pUsxeDjxiG8WyhBFW/RZVW5Zah9stoRF2UVSA+5NpXh gMqcXB+f+yDTP/88WOIhkGqhyYXpx4i/8YekX1fDJ0w+piOLaJq+EDu23j3qknxO0PdB mzyA== X-Received: by 10.66.164.66 with SMTP id yo2mr31167550pab.59.1425119324026; Sat, 28 Feb 2015 02:28:44 -0800 (PST) Received: from localhost.localdomain (cpe-45-48-59-37.socal.res.rr.com. [45.48.59.37]) by mx.google.com with ESMTPSA id d4sm454934pdm.50.2015.02.28.02.28.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 28 Feb 2015 02:28:43 -0800 (PST) From: Brian Norris <computersforpeace@gmail.com> To: Richard Weinberger <richard@nod.at>, Artem Bityutskiy <dedekind1@gmail.com> Subject: [PATCH 2/5] UBI: fix out of bounds write Date: Sat, 28 Feb 2015 02:23:26 -0800 Message-Id: <1425119009-28634-3-git-send-email-computersforpeace@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1425119009-28634-1-git-send-email-computersforpeace@gmail.com> References: <1425119009-28634-1-git-send-email-computersforpeace@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150228_022905_543480_497EB5D8 X-CRM114-Status: UNSURE ( 7.74 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c03:0:0:0:22d listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (computersforpeace[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain Cc: kernel-janitors@vger.kernel.org, Brian Norris <computersforpeace@gmail.com>, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.18-1 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> 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/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c index da4c79259f67..6442d3fbcb73 100644 --- a/drivers/mtd/ubi/eba.c +++ b/drivers/mtd/ubi/eba.c @@ -1418,7 +1418,8 @@ int ubi_eba_init(struct ubi_device *ubi, struct ubi_attach_info *ai) * during re-size. */ ubi_move_aeb_to_list(av, aeb, &ai->erase); - vol->eba_tbl[aeb->lnum] = aeb->pnum; + else + vol->eba_tbl[aeb->lnum] = aeb->pnum; } }
If aeb->len >= vol->reserved_pebs, we should not be writing aeb into the PEB->LEB mapping. Caught by Coverity, CID #711212. Signed-off-by: Brian Norris <computersforpeace@gmail.com> --- drivers/mtd/ubi/eba.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)