[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <20061227165731.PS48805300021@infradead.org>
Date: Wed, 27 Dec 2006 14:57:31 -0200
From: Mauro Carvalho Chehab <mchehab@...radead.org>
To: LKML <linux-kernel@...r.kernel.org>
Cc: V4L-DVB Maintainers <v4l-dvb-maintainer@...uxtv.org>,
Akinobu Mita <akinobu.mita@...il.com>,
Mauro Carvalho Chehab <mchehab@...radead.org>
Subject: [PATCH 21/28] V4L/DVB (4994): Vivi: fix use after free in
list_for_each()
From: Akinobu Mita <akinobu.mita@...il.com>
Freeing data including list_head in list_for_each() is not safe.
Signed-off-by: Akinobu Mita <akinobu.mita@...il.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@...radead.org>
---
drivers/media/video/vivi.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index 474ddb7..3cead24 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -1363,7 +1363,9 @@ static void __exit vivi_exit(void)
struct vivi_dev *h;
struct list_head *list;
- list_for_each(list,&vivi_devlist) {
+ while (!list_empty(&vivi_devlist)) {
+ list = vivi_devlist.next;
+ list_del(list);
h = list_entry(list, struct vivi_dev, vivi_devlist);
kfree (h);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists