提交 a50d28de 编写于 作者: B Bruno Prémont 提交者: Paul Mundt

video: Fix use-after-free by vga16fb on rmmod

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.

CC: stable@kernel.org
Signed-off-by: NBruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
上级 1b86d775
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册