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
..
2022-03-31 13:08:13 -07:00
2022-03-25 13:35:34 -07:00
2022-04-02 11:03:03 -07:00
2022-03-24 19:37:53 -07:00
2022-03-23 18:03:08 -07:00
2022-03-30 16:17:54 -07:00
2022-03-31 13:57:15 -07:00
2022-03-24 18:12:09 -07:00
2022-03-30 10:54:49 -07:00
2022-04-01 10:26:09 -07:00
2022-03-24 12:30:37 -07:00
2022-03-24 19:37:53 -07:00
2022-03-29 08:50:14 -07:00
2022-03-23 18:03:08 -07:00
2022-03-24 16:19:43 -07:00
2022-03-23 18:23:13 -07:00
2022-03-25 13:56:18 -07:00
2022-03-31 13:57:15 -07:00
2022-03-21 18:33:57 -07:00
2022-03-30 10:04:11 -07:00
2022-04-01 16:26:57 -07:00
2022-04-02 10:54:52 -07:00
2022-04-02 10:44:18 -07:00
2022-03-21 14:46:01 -07:00
2022-03-28 12:41:28 -07:00
2022-03-30 10:58:28 -07:00
2022-03-30 10:50:48 -07:00
2022-04-01 09:37:18 -07:00
2022-03-27 22:18:39 +02:00
2022-03-28 14:32:39 -07:00
2022-03-24 13:13:26 -07:00
2022-03-25 13:35:34 -07:00
2022-03-24 19:37:53 -07:00
2022-03-23 18:23:13 -07:00
2022-03-18 19:00:26 +01:00
2022-03-28 14:32:39 -07:00
2022-03-31 13:57:15 -07:00
2022-03-31 13:57:15 -07:00
2022-03-31 13:57:15 -07:00
2022-03-31 14:14:03 -07:00