Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fbcon: Avoid OOB font access if console rotation fails

Clear the font buffer if the reallocation during console rotation fails
in fbcon_rotate_font(). The putcs implementations for the rotated buffer
will return early in this case. See [1] for an example.

Currently, fbcon_rotate_font() keeps the old buffer, which is too small
for the rotated font. Printing to the rotated console with a high-enough
character code will overflow the font buffer.

v2:
- fix typos in commit message

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 6cc50e1c5b57 ("[PATCH] fbcon: Console Rotation - Add support to rotate font bitmap")
Cc: stable@vger.kernel.org # v2.6.15+
Link: https://elixir.bootlin.com/linux/v6.19/source/drivers/video/fbdev/core/fbcon_ccw.c#L144 # [1]
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

Thomas Zimmermann and committed by
Helge Deller
e4ef723d a9cdba5c

+4 -1
+4 -1
drivers/video/fbdev/core/fbcon_rotate.c
··· 46 46 info->fbops->fb_sync(info); 47 47 48 48 if (par->fd_size < d_cellsize * len) { 49 + kfree(par->fontbuffer); 50 + par->fontbuffer = NULL; 51 + par->fd_size = 0; 52 + 49 53 dst = kmalloc_array(len, d_cellsize, GFP_KERNEL); 50 54 51 55 if (dst == NULL) { ··· 58 54 } 59 55 60 56 par->fd_size = d_cellsize * len; 61 - kfree(par->fontbuffer); 62 57 par->fontbuffer = dst; 63 58 } 64 59