Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCH 0/4] drm: Safe font-data access in log/panic drawing
@ 2026-05-29 14:01 Thomas Zimmermann
  2026-05-29 14:01 ` [PATCH 1/4] lib/fonts: Look up glyph data with font_data_glyph_buf() Thomas Zimmermann
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Thomas Zimmermann @ 2026-05-29 14:01 UTC (permalink / raw)
  To: jfalempe, javierm, deller, maarten.lankhorst, mripard, airlied,
	simona
  Cc: dri-devel, linux-fbdev, Thomas Zimmermann

Looking up glyph shapes with a signed char in drm_draw_get_char_bitmap()
is unsafe. It also does not support extended ASCII codes with values
larger than 127.

Add the new function font_data_glyph_buf() to the font-data helpers. It
looks up the correct glyph from font data or returns NULL if no such
glyph exists. Convert DRM's log and panic code to the new function. Also
cast the character code to support all 256 ASCII characters.

Tested with drm_log on bochs.

Thomas Zimmermann (4):
  lib/fonts: Look up glyph data with font_data_glyph_buf()
  drm/client: log: Look up glyph shape with font helper
  drm/panic: Look up glyph shape with font helper
  drm/draw: Remove unused helper drm_draw_get_char_bitmap()

 drivers/gpu/drm/clients/drm_log.c   | 10 ++++++----
 drivers/gpu/drm/drm_draw_internal.h |  7 -------
 drivers/gpu/drm/drm_panic.c         |  6 ++++--
 include/linux/font.h                |  3 +++
 lib/fonts/fonts.c                   | 31 +++++++++++++++++++++++++++++
 5 files changed, 44 insertions(+), 13 deletions(-)

-- 
2.54.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-29 14:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-29 14:01 [PATCH 0/4] drm: Safe font-data access in log/panic drawing Thomas Zimmermann
2026-05-29 14:01 ` [PATCH 1/4] lib/fonts: Look up glyph data with font_data_glyph_buf() Thomas Zimmermann
2026-05-29 14:01 ` [PATCH 2/4] drm/client: log: Look up glyph shape with font helper Thomas Zimmermann
2026-05-29 14:01 ` [PATCH 3/4] drm/panic: " Thomas Zimmermann
2026-05-29 14:01 ` [PATCH 4/4] drm/draw: Remove unused helper drm_draw_get_char_bitmap() Thomas Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox