From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 414CAC28CC4 for ; Tue, 2 Mar 2021 20:14:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F90564F25 for ; Tue, 2 Mar 2021 20:14:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1836486AbhCBUJA (ORCPT ); Tue, 2 Mar 2021 15:09:00 -0500 Received: from mslow2.mail.gandi.net ([217.70.178.242]:42527 "EHLO mslow2.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442053AbhCBRaZ (ORCPT ); Tue, 2 Mar 2021 12:30:25 -0500 Received: from relay6-d.mail.gandi.net (unknown [217.70.183.198]) by mslow2.mail.gandi.net (Postfix) with ESMTP id DE50A3A0417; Tue, 2 Mar 2021 17:17:46 +0000 (UTC) X-Originating-IP: 86.206.8.148 Received: from xps13.stephanxp.local (lfbn-tou-1-491-148.w86-206.abo.wanadoo.fr [86.206.8.148]) (Authenticated sender: miquel.raynal@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 197F8C0009; Tue, 2 Mar 2021 17:14:50 +0000 (UTC) From: Miquel Raynal To: "Gustavo A. R. Silva" , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Serge Semin Cc: linux-hardening@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Kees Cook Subject: Re: [PATCH] mtd: physmap: physmap-bt1-rom: Fix unintentional stack access Date: Tue, 2 Mar 2021 18:14:50 +0100 Message-Id: <20210302171450.1871-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210212104022.GA242669@embeddedor> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: 7b3e9c56e6be29e387c47e94c802736d01df1e9b Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2021-02-12 at 10:40:22 UTC, "Gustavo A. R. Silva" wrote: > Cast &data to (char *) in order to avoid unintentionally accessing > the stack. > > Notice that data is of type u32, so any increment to &data > will be in the order of 4-byte chunks, and this piece of code > is actually intended to be a byte offset. > > Fixes: b3e79e7682e0 ("mtd: physmap: Add Baikal-T1 physically mapped ROM support") > Addresses-Coverity-ID: 1497765 ("Out-of-bounds access") > Cc: stable@vger.kernel.org > Signed-off-by: Gustavo A. R. Silva > Acked-by: Serge Semin Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks. Miquel