[PATCH] mtd: spi-nor: Don't copy self-pointing struct around

Vignesh Raghavendra vigneshr at ti.com
Thu Oct 29 00:45:08 EDT 2020


On Mon, 5 Oct 2020 10:48:03 +0200, Alexander A Sverdlin wrote:
> spi_nor_parse_sfdp() modifies the passed structure so that it points to
> itself (params.erase_map.regions to params.erase_map.uniform_region). This
> makes it impossible to copy the local struct anywhere else.
> 
> Therefore only use memcpy() in backup-restore scenario. The bug may show up
> like below:
> 
> [...]

Updated Fixes tag as suggested by Tudor.
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/fixes, thanks!
[1/1] mtd: spi-nor: Don't copy self-pointing struct around
      https://git.kernel.org/mtd/c/69a8eed58c

--
Regards
Vignesh




More information about the linux-mtd mailing list