All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vignesh Raghavendra <vigneshr@ti.com>
To: Tudor Ambarus <tudor.ambarus@microchip.com>,
	Alexander A Sverdlin <alexander.sverdlin@nokia.com>,
	<linux-mtd@lists.infradead.org>
Cc: Vignesh Raghavendra <vigneshr@ti.com>,
	Richard Weinberger <richard@nod.at>,
	Matija Glavinic Pecotic <matija.glavinic-pecotic.ext@nokia.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mtd: spi-nor: Don't copy self-pointing struct around
Date: Thu, 29 Oct 2020 10:15:08 +0530	[thread overview]
Message-ID: <160390597173.12290.18229990126806445717.b4-ty@ti.com> (raw)
In-Reply-To: <20201005084803.23460-1-alexander.sverdlin@nokia.com>

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


WARNING: multiple messages have this Message-ID (diff)
From: Vignesh Raghavendra <vigneshr@ti.com>
To: Tudor Ambarus <tudor.ambarus@microchip.com>,
	Alexander A Sverdlin <alexander.sverdlin@nokia.com>,
	<linux-mtd@lists.infradead.org>
Cc: Richard Weinberger <richard@nod.at>,
	Matija Glavinic Pecotic <matija.glavinic-pecotic.ext@nokia.com>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-kernel@vger.kernel.org,
	Miquel Raynal <miquel.raynal@bootlin.com>
Subject: Re: [PATCH] mtd: spi-nor: Don't copy self-pointing struct around
Date: Thu, 29 Oct 2020 10:15:08 +0530	[thread overview]
Message-ID: <160390597173.12290.18229990126806445717.b4-ty@ti.com> (raw)
In-Reply-To: <20201005084803.23460-1-alexander.sverdlin@nokia.com>

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


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  parent reply	other threads:[~2020-10-29 13:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-05  8:48 [PATCH] mtd: spi-nor: Don't copy self-pointing struct around Alexander A Sverdlin
2020-10-05  8:48 ` Alexander A Sverdlin
2020-10-07  8:48 ` Tudor.Ambarus
2020-10-07  8:48   ` Tudor.Ambarus
2020-10-07  9:11   ` Alexander Sverdlin
2020-10-07  9:11     ` Alexander Sverdlin
2020-10-29  4:45 ` Vignesh Raghavendra [this message]
2020-10-29  4:45   ` Vignesh Raghavendra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=160390597173.12290.18229990126806445717.b4-ty@ti.com \
    --to=vigneshr@ti.com \
    --cc=alexander.sverdlin@nokia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=matija.glavinic-pecotic.ext@nokia.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=tudor.ambarus@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.