Skip to content

drm: Safe font-data access in log/panic drawing

Thomas Zimmermann dri-devel linux-fbdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4lib/fonts: Look up glyph data with font_data_glyph_buf()include/linux/font.h lib/fonts/fonts.c+34 -02 replies
2/4drm/client: log: Look up glyph shape with font helperdrivers/gpu/drm/clients/drm_log.c+6 -41 reply
3/4drm/panic: Look up glyph shape with font helperdrivers/gpu/drm/drm_panic.c+4 -21 reply
4/4drm/draw: Remove unused helper drm_draw_get_char_bitmap()drivers/gpu/drm/drm_draw_internal.h+0 -71 reply

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchJocelyn Falempe
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] drm: Safe font-data access in log/panic drawing

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(-)
Signature · 1 line
2.54.0