[PATCH 0/2] fbdev: fix udlfb shadow buffer and framebuffer registration

From: YuanZhe Liu

Date: Fri Dec 04 2026 - 04:05:34 EST


These patches fix 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.

Based on v7.3.5.

YuanZhe Liu (2):
fbdev: udlfb: drop stale shadow buffer 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 | 12 ++++++++++--
2 files changed, 17 insertions(+), 3 deletions(-)

--
2.34.1