diff options
author | Bruno Prémont <bonbons@linux-vserver.org> | 2011-05-24 19:59:17 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-06-23 15:05:35 -0700 |
commit | dec314e6cc29b2c5d19aa84c1267a1dd750451cf (patch) | |
tree | 7c790cb3e2e887bc5a32ce95637f253bfa2df456 | |
parent | 8f83b904ea7590794fc8ce490eaf57ac68955ee7 (diff) | |
download | lwn-dec314e6cc29b2c5d19aa84c1267a1dd750451cf.tar.gz lwn-dec314e6cc29b2c5d19aa84c1267a1dd750451cf.zip |
video: Fix use-after-free by vga16fb on rmmod
commit a50d28de8d5085e0f34f96088a45cc156d022021 upstream.
Since fb_info is now refcounted and thus may get freed at any time it
gets unregistered module unloading will try to unregister framebuffer
as stored in platform data on probe though this pointer may
be stale.
Cleanup platform data on framebuffer release.
Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/video/vga16fb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c index 53b2c5aae067..305c975b1787 100644 --- a/drivers/video/vga16fb.c +++ b/drivers/video/vga16fb.c @@ -1265,9 +1265,11 @@ static void vga16fb_imageblit(struct fb_info *info, const struct fb_image *image static void vga16fb_destroy(struct fb_info *info) { + struct platform_device *dev = container_of(info->device, struct platform_device, dev); iounmap(info->screen_base); fb_dealloc_cmap(&info->cmap); /* XXX unshare VGA regions */ + platform_set_drvdata(dev, NULL); framebuffer_release(info); } |