diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2008-01-11 08:27:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-01-11 14:47:42 -0500 |
commit | ba21611c9c0031ca8388cae5e43b38c29c8b595d (patch) | |
tree | c2062639f66ea8aebd1b874f291cfdcc6aee7e27 /drivers/video | |
parent | b506d1b6c49a5884ff67a29bc99a1912ee20acee (diff) |
ps3fb: prevent use after free of fb_info
In ps3fb_shutdown, freeing the framebuffer will cause fb_info (in
dev->core.driver_data) to be free()ed, which we potentially access
from the ps3fbd kthread.
This change frees the framebuffer after stopping the ps3fbd kthread.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/ps3fb.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c index b3128903d673..ae07e02943d8 100644 --- a/drivers/video/ps3fb.c +++ b/drivers/video/ps3fb.c | |||
@@ -1234,12 +1234,6 @@ static int ps3fb_shutdown(struct ps3_system_bus_device *dev) | |||
1234 | ps3fb_flip_ctl(0, &ps3fb); /* flip off */ | 1234 | ps3fb_flip_ctl(0, &ps3fb); /* flip off */ |
1235 | ps3fb.dinfo->irq.mask = 0; | 1235 | ps3fb.dinfo->irq.mask = 0; |
1236 | 1236 | ||
1237 | if (info) { | ||
1238 | unregister_framebuffer(info); | ||
1239 | fb_dealloc_cmap(&info->cmap); | ||
1240 | framebuffer_release(info); | ||
1241 | } | ||
1242 | |||
1243 | ps3av_register_flip_ctl(NULL, NULL); | 1237 | ps3av_register_flip_ctl(NULL, NULL); |
1244 | if (ps3fb.task) { | 1238 | if (ps3fb.task) { |
1245 | struct task_struct *task = ps3fb.task; | 1239 | struct task_struct *task = ps3fb.task; |
@@ -1250,6 +1244,12 @@ static int ps3fb_shutdown(struct ps3_system_bus_device *dev) | |||
1250 | free_irq(ps3fb.irq_no, &dev->core); | 1244 | free_irq(ps3fb.irq_no, &dev->core); |
1251 | ps3_irq_plug_destroy(ps3fb.irq_no); | 1245 | ps3_irq_plug_destroy(ps3fb.irq_no); |
1252 | } | 1246 | } |
1247 | if (info) { | ||
1248 | unregister_framebuffer(info); | ||
1249 | fb_dealloc_cmap(&info->cmap); | ||
1250 | framebuffer_release(info); | ||
1251 | info = dev->core.driver_data = NULL; | ||
1252 | } | ||
1253 | iounmap((u8 __iomem *)ps3fb.dinfo); | 1253 | iounmap((u8 __iomem *)ps3fb.dinfo); |
1254 | 1254 | ||
1255 | status = lv1_gpu_context_free(ps3fb.context_handle); | 1255 | status = lv1_gpu_context_free(ps3fb.context_handle); |