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

fbcon: fix rotate upside down crash

Fix the rotate_ud() function not to crash in case of a font which has not
a width of multiple by 8: The inner loop of the font pixel copy should not
access a bit outside the font memory area. Subtract the shift offset from
the font width will prevent this.

Signed-off-by: Stefani Seibold <stefani@seibold.net>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Stefani Seibold and committed by
Linus Torvalds
93274e4d 69dd647f

+1 -1
+1 -1
drivers/video/console/fbcon_rotate.h
··· 45 45 width = (width + 7) & ~7; 46 46 47 47 for (i = 0; i < height; i++) { 48 - for (j = 0; j < width; j++) { 48 + for (j = 0; j < width - shift; j++) { 49 49 if (pattern_test_bit(j, i, width, in)) 50 50 pattern_set_bit(width - (1 + j + shift), 51 51 height - (1 + i),