linux/lib/fonts
Peilin Ye 272d708951 Fonts: Support FONT_EXTRA_WORDS macros for font_6x8
Recently, in commit 6735b4632d ("Fonts: Support FONT_EXTRA_WORDS macros
for built-in fonts"), we wrapped each of our built-in data buffers in a
`font_data` structure, in order to use the following macros on them, see
include/linux/font.h:

	#define REFCOUNT(fd)	(((int *)(fd))[-1])
	#define FNTSIZE(fd)	(((int *)(fd))[-2])
	#define FNTCHARCNT(fd)	(((int *)(fd))[-3])
	#define FNTSUM(fd)	(((int *)(fd))[-4])

	#define FONT_EXTRA_WORDS 4

Do the same thing to our new 6x8 font. For built-in fonts, currently we
only use FNTSIZE(). Since this is only a temporary solution for an
out-of-bounds issue in the framebuffer layer (see commit 5af0864079
("fbcon: Fix global-out-of-bounds read in fbcon_get_font()")), all the
three other fields are intentionally set to zero in order to discourage
using these negative-indexing macros.

Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/926453876c92caac34cba8545716a491754d04d5.1603037079.git.yepeilin.cs@gmail.com
2020-10-19 17:55:10 +02:00
..
font_6x8.c Fonts: Support FONT_EXTRA_WORDS macros for font_6x8 2020-10-19 17:55:10 +02:00
font_6x10.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
font_6x11.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
font_7x14.c lib/fonts: convert comments to utf-8 2018-08-23 18:48:43 -07:00
font_8x8.c lib/fonts: convert comments to utf-8 2018-08-23 18:48:43 -07:00
font_8x16.c lib/fonts: convert comments to utf-8 2018-08-23 18:48:43 -07:00
font_10x18.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
font_acorn_8x8.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
font_mini_4x6.c
font_pearl_8x8.c lib/fonts: convert comments to utf-8 2018-08-23 18:48:43 -07:00
font_sun8x16.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
font_sun12x22.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
font_ter16x32.c Fonts: New Terminus large console font 2018-12-19 10:42:08 +01:00
fonts.c lib/fonts: add font 6x8 for OLED display 2020-09-08 13:33:21 +02:00
Kconfig lib/fonts: add font 6x8 for OLED display 2020-09-08 13:33:21 +02:00
Makefile lib/fonts: add font 6x8 for OLED display 2020-09-08 13:33:21 +02:00