[PATCH] mtd: physmap: physmap-bt1-rom: Fix unintentional stack access

Miquel Raynal miquel.raynal at bootlin.com
Tue Mar 2 17:14:50 GMT 2021


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 at vger.kernel.org
> Signed-off-by: Gustavo A. R. Silva <gustavoars at kernel.org>
> Acked-by: Serge Semin <fancer.lancer at gmail.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel



More information about the linux-mtd mailing list