Takashi Iwai 3efc61d952 fbdev: Fix invalid page access after closing deferred I/O devices
When a fbdev with deferred I/O is once opened and closed, the dirty
pages still remain queued in the pageref list, and eventually later
those may be processed in the delayed work.  This may lead to a
corruption of pages, hitting an Oops.

This patch makes sure to cancel the delayed work and clean up the
pageref list at closing the device for addressing the bug.  A part of
the cleanup code is factored out as a new helper function that is
called from the common fb_release().

Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tested-by: Miko Larsson <mikoxyzzz@gmail.com>
Fixes: 56c134f7f1b5 ("fbdev: Track deferred-I/O pages in pageref struct")
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230129082856.22113-1-tiwai@suse.de
2023-02-10 11:03:37 +01:00
..
2022-12-14 20:01:51 +01:00
2022-11-24 11:05:43 +10:00
2020-01-15 17:31:50 +01:00
2022-11-24 11:05:43 +10:00
2022-06-20 18:21:25 +02:00
2020-02-19 10:58:22 -08:00
2022-12-13 11:59:58 -08:00
2022-12-14 20:01:51 +01:00
2020-01-30 08:04:01 -08:00
2020-01-30 08:04:01 -08:00
2020-01-30 08:04:01 -08:00
2022-03-24 16:19:43 -07:00
2020-01-30 08:04:01 -08:00