[PATCH v2 0/2] fbdev: fix udlfb shadow buffer and framebuffer registration
From: YuanZhe Liu
Date: Fri Dec 04 2026 - 04:36:16 EST
This series fixes two independent problems in the fbdev paths used by
the udlfb driver. Both were found while analyzing failures observed on
a DisplayLink USB adapter; the changes are compile-tested only and no
hardware testing was performed.
Patch 1 fixes an out-of-bounds read when the framebuffer is switched to
a larger mode while the shadow buffer is disabled or its allocation
fails. The driver kept the previous, smaller shadow buffer and
dlfb_render_hline() used it to compare lines of the larger framebuffer.
Patch 2 fixes framebuffer registration reporting a failure after the
framebuffer has already been registered. A failed console takeover is
not fatal for the framebuffer itself, but drivers treated the error as
fatal, freed the live fb_info and left a dangling entry in
registered_fb[]; the next open then dereferenced freed memory.
Changes in v2:
- Patch 1: publish the new buffers and geometry under
dlfb->render_mutex, free the stale shadow buffer directly, and
validate damage requests against the installed framebuffer.
Patch 2 is unchanged.
Based on v7.3.5.
YuanZhe Liu (2):
fbdev: udlfb: fix shadow buffer handling when the framebuffer grows
fbdev: fbmem: don't fail registration when fbcon cannot take over
drivers/video/fbdev/core/fbmem.c | 8 +++++-
drivers/video/fbdev/udlfb.c | 45 +++++++++++++++++++++++++-------
2 files changed, 43 insertions(+), 10 deletions(-)
--
2.34.1