Skip to content
Commit 87b9802c authored by Takashi Iwai's avatar Takashi Iwai Committed by Greg Kroah-Hartman
Browse files

fbdev: Fix invalid page access after closing deferred I/O devices



[ Upstream commit 3efc61d9 ]

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: default avatarPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Tested-by: default avatarMiko Larsson <mikoxyzzz@gmail.com>
Fixes: 56c134f7 ("fbdev: Track deferred-I/O pages in pageref struct")
Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230129082856.22113-1-tiwai@suse.de


Stable-dep-of: 33cd6ea9 ("fbdev: flush deferred IO before closing")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 9a95fc04
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment