public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "mtd: spinand: Fix OOB read"
@ 2021-01-05 10:18 Felix Fietkau
  2021-01-05 10:31 ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Felix Fietkau @ 2021-01-05 10:18 UTC (permalink / raw)
  To: stable; +Cc: gregkh, Miquel Raynal

This reverts stable commit baad618d078c857f99cc286ea249e9629159901f.

This commit is adding lines to spinand_write_to_cache_op, wheras the upstream
commit 868cbe2a6dcee451bd8f87cbbb2a73cf463b57e5 that this was supposed to
backport was touching spinand_read_from_cache_op.
It causes a crash on writing OOB data by attempting to write to read-only
kernel memory.

Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/mtd/nand/spi/core.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 7900571fc85b..c35221794645 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -318,10 +318,6 @@ static int spinand_write_to_cache_op(struct spinand_device *spinand,
 		buf += ret;
 	}
 
-	if (req->ooblen)
-		memcpy(req->oobbuf.in, spinand->oobbuf + req->ooboffs,
-		       req->ooblen);
-
 	return 0;
 }
 
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-05 11:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-05 10:18 [PATCH] Revert "mtd: spinand: Fix OOB read" Felix Fietkau
2021-01-05 10:31 ` Greg KH
2021-01-05 10:40   ` Felix Fietkau
2021-01-05 10:50     ` Greg KH
2021-01-05 10:40   ` Miquel Raynal
2021-01-05 10:47     ` Felix Fietkau
2021-01-05 11:05       ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox