Skip to content

Commit

Permalink
video: Fix use-after-free by vga16fb on rmmod
Browse files Browse the repository at this point in the history
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: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Bruno Prémont authored and Paul Mundt committed Jun 6, 2011
1 parent 1b86d77 commit a50d28d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/video/vga16fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit a50d28d

Please sign in to comment.