* [PATCH] nand-bb: mtd_del_bb: fix missing pointer reset
@ 2018-06-18 9:52 Heinrich.Toews
2018-06-18 10:48 ` [PATCH v2] " Heinrich.Toews
0 siblings, 1 reply; 3+ messages in thread
From: Heinrich.Toews @ 2018-06-18 9:52 UTC (permalink / raw)
To: barebox; +Cc: Heinrich.Toews
From: Töws, Heinrich <Heinrich.Toews@wago.com>
If an attached bb device was removed before the actual mtd device
the code would try due to a missing pointer reset to access
the no more present bb device handle which leads to a page fault.
This bug was made visible by commit "7649473 mtd: nand: remove
automatically created bb devices" which relys on a correct
mtd->cdev_bb handling.
---
drivers/mtd/nand/nand-bb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/mtd/nand/nand-bb.c b/drivers/mtd/nand/nand-bb.c
index c197738..012163e 100644
--- a/drivers/mtd/nand/nand-bb.c
+++ b/drivers/mtd/nand/nand-bb.c
@@ -316,6 +316,8 @@ void mtd_del_bb(struct mtd_info *mtd)
list_del_init(&bb->list);
free(bb->name);
free(bb);
+
+ mtd->cdev_bb = NULL;
}
/**
--
2.7.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] nand-bb: mtd_del_bb: fix missing pointer reset
2018-06-18 9:52 [PATCH] nand-bb: mtd_del_bb: fix missing pointer reset Heinrich.Toews
@ 2018-06-18 10:48 ` Heinrich.Toews
2018-06-18 20:54 ` Sascha Hauer
0 siblings, 1 reply; 3+ messages in thread
From: Heinrich.Toews @ 2018-06-18 10:48 UTC (permalink / raw)
To: barebox
If an attached bb device was removed before the actual mtd device
the code would try due to a missing pointer reset to access
the no more present bb device handle which leads to a page fault.
This bug was made visible by commit "7649473 mtd: nand: remove
automatically created bb devices" which relys on a correct
mtd->cdev_bb handling.
Signed-off-by: Heinrich Toews <heinrich.toews@wago.com>
---
Change since v1: add Signed-off-by
---
drivers/mtd/nand/nand-bb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/mtd/nand/nand-bb.c b/drivers/mtd/nand/nand-bb.c
index c197738..012163e 100644
--- a/drivers/mtd/nand/nand-bb.c
+++ b/drivers/mtd/nand/nand-bb.c
@@ -316,6 +316,8 @@ void mtd_del_bb(struct mtd_info *mtd)
list_del_init(&bb->list);
free(bb->name);
free(bb);
+
+ mtd->cdev_bb = NULL;
}
/**
--
2.7.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] nand-bb: mtd_del_bb: fix missing pointer reset
2018-06-18 10:48 ` [PATCH v2] " Heinrich.Toews
@ 2018-06-18 20:54 ` Sascha Hauer
0 siblings, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2018-06-18 20:54 UTC (permalink / raw)
To: Heinrich.Toews; +Cc: barebox
On Mon, Jun 18, 2018 at 10:48:18AM +0000, Heinrich.Toews@wago.com wrote:
> If an attached bb device was removed before the actual mtd device
> the code would try due to a missing pointer reset to access
> the no more present bb device handle which leads to a page fault.
>
> This bug was made visible by commit "7649473 mtd: nand: remove
> automatically created bb devices" which relys on a correct
> mtd->cdev_bb handling.
>
> Signed-off-by: Heinrich Toews <heinrich.toews@wago.com>
> ---
> Change since v1: add Signed-off-by
Applied, thanks
Sascha
> ---
> drivers/mtd/nand/nand-bb.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mtd/nand/nand-bb.c b/drivers/mtd/nand/nand-bb.c
> index c197738..012163e 100644
> --- a/drivers/mtd/nand/nand-bb.c
> +++ b/drivers/mtd/nand/nand-bb.c
> @@ -316,6 +316,8 @@ void mtd_del_bb(struct mtd_info *mtd)
> list_del_init(&bb->list);
> free(bb->name);
> free(bb);
> +
> + mtd->cdev_bb = NULL;
> }
>
> /**
> --
> 2.7.4
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-06-18 20:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-18 9:52 [PATCH] nand-bb: mtd_del_bb: fix missing pointer reset Heinrich.Toews
2018-06-18 10:48 ` [PATCH v2] " Heinrich.Toews
2018-06-18 20:54 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox