From: Thomas Zimmermann <tzimmermann@suse.de>
To: jfalempe@redhat.com, javierm@redhat.com, deller@gmx.de,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
airlied@gmail.com, simona@ffwll.ch
Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH 0/4] drm: Safe font-data access in log/panic drawing
Date: Fri, 29 May 2026 16:01:22 +0200 [thread overview]
Message-ID: <20260529140759.529929-1-tzimmermann@suse.de> (raw)
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
next reply other threads:[~2026-05-29 14:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 14:01 Thomas Zimmermann [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260529140759.529929-1-tzimmermann@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@gmail.com \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=javierm@redhat.com \
--cc=jfalempe@redhat.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox