linux-stable/drivers/video/fbdev/core
Daniel Vetter 89bfd4017e
fbdev: Prevent possible use-after-free in fb_release()
Most fbdev drivers have issues with the fb_info lifetime, because call to
framebuffer_release() from their driver's .remove callback, rather than
doing from fbops.fb_destroy callback.

Doing that will destroy the fb_info too early, while references to it may
still exist, leading to a use-after-free error.

To prevent this, check the fb_info reference counter when attempting to
kfree the data structure in framebuffer_release(). That will leak it but
at least will prevent the mentioned error.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220505220413.365977-1-javierm@redhat.com
2022-05-06 09:21:20 +02:00
..
bitblit.c Revert "fbdev: Garbage collect fbdev scrolling acceleration, part 1 (from TODO list)" 2022-02-02 15:14:56 +01:00
cfbcopyarea.c
cfbfillrect.c
cfbimgblt.c fbdev: Fix cfb_imageblit() for arbitrary image widths 2022-03-25 09:55:54 +10:00
fb_cmdline.c
fb_ddc.c
fb_defio.c drm for 5.18-rc1 2022-03-24 16:19:43 -07:00
fb_draw.h
fb_notify.c
fb_sys_fops.c
fbcmap.c fbdev: zero-fill colormap in fbcmap.c 2021-04-10 11:12:08 +02:00
fbcon.c fbcon: Avoid 'cap' set but not used warning 2022-02-08 14:44:15 +01:00
fbcon.h fbcon: Add option to enable legacy hardware acceleration 2022-02-02 15:16:26 +01:00
fbcon_ccw.c fbcon: Add option to enable legacy hardware acceleration 2022-02-02 15:16:26 +01:00
fbcon_cw.c fbcon: Add option to enable legacy hardware acceleration 2022-02-02 15:16:26 +01:00
fbcon_rotate.c
fbcon_rotate.h fbcon: Add option to enable legacy hardware acceleration 2022-02-02 15:16:26 +01:00
fbcon_ud.c fbcon: Add option to enable legacy hardware acceleration 2022-02-02 15:16:26 +01:00
fbcvt.c video: fbdev: fbcvt.c: fix printing in fb_cvt_print_name() 2022-01-30 21:19:22 +01:00
fbmem.c Revert "fbdev: Make fb_release() return -ENODEV if fbdev was unregistered" 2022-05-06 09:19:02 +02:00
fbmon.c
fbsysfs.c fbdev: Prevent possible use-after-free in fb_release() 2022-05-06 09:21:20 +02:00
Makefile
modedb.c
softcursor.c
svgalib.c
syscopyarea.c
sysfillrect.c fbdev: Improve performance of sys_fillrect() 2022-03-02 20:20:34 +01:00
sysimgblt.c fbdev: Fix sys_imageblit() for arbitrary image widths 2022-03-25 09:55:52 +10:00
tileblit.c Revert "fbdev: Garbage collect fbdev scrolling acceleration, part 1 (from TODO list)" 2022-02-02 15:14:56 +01:00