Linux Documentation
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: jfalempe@redhat.com, javierm@redhat.com, airlied@gmail.com,
	simona@ffwll.ch, maarten.lankhorst@linux.intel.com,
	mripard@kernel.org, geert@linux-m68k.org, rdunlap@infradead.org
Cc: dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, rust-for-linux@vger.kernel.org,
	linux-hyperv@vger.kernel.org, intel-gfx@lists.freedesktop.org,
	intel-xe@lists.freedesktop.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	nouveau@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org,
	virtualization@lists.linux.dev, sashiko-reviews@lists.linux.dev,
	Thomas Zimmermann <tzimmermann@suse.de>,
	stable@vger.kernel.org
Subject: [PATCH v2 01/13] drm/panic: Do not use un-escaped URL as format string
Date: Mon, 24 Aug 2026 14:43:32 +0200	[thread overview]
Message-ID: <20260824125201.218863-2-tzimmermann@suse.de> (raw)
In-Reply-To: <20260824125201.218863-1-tzimmermann@suse.de>

Replace the direct use of DRM_PANIC_SCREEN_QR_CODE_URL in snprintf()
with a %s conversion specifier. Avoids a possible vulnerabilty from
a crafted URL string.

As the attacker needs to control the kernel at the Kconfig level, the
potential for an exploit is likely low.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: cb5164ac43d0 ("drm/panic: Add a QR code panic screen")
Cc: Javier Martinez Canillas <javierm@redhat.com>
Cc: Jocelyn Falempe <jfalempe@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v6.12+
---
 drivers/gpu/drm/drm_panic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c
index e576c4791861..ba21df4be338 100644
--- a/drivers/gpu/drm/drm_panic.c
+++ b/drivers/gpu/drm/drm_panic.c
@@ -658,7 +658,8 @@ static int drm_panic_get_qr_code_url(u8 **qr_image)
 	char *kmsg;
 	int max_qr_data_size, url_len;
 
-	url_len = snprintf(url, sizeof(url), CONFIG_DRM_PANIC_SCREEN_QR_CODE_URL "?a=%s&v=%s&z=",
+	url_len = snprintf(url, sizeof(url), "%s?a=%s&v=%s&z=",
+			   CONFIG_DRM_PANIC_SCREEN_QR_CODE_URL,
 			   utsname()->machine, utsname()->release);
 
 	max_qr_data_size = drm_panic_qr_max_data_size(panic_qr_version, url_len);
-- 
2.55.0


  reply	other threads:[~2026-08-24 12:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24 12:43 [PATCH v2 00/13] drm/panic: Split into core and helpers Thomas Zimmermann
2026-08-24 12:43 ` Thomas Zimmermann [this message]
2026-08-24 12:43 ` [PATCH v2 02/13] drm/panic: Test address from kmap op for NULL Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 03/13] drm/panic: Return -EINVAL if font is not available Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 04/13] drm/panic: Return errno codes if panic output fails Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 05/13] drm/panic: Pass colors to draw_panic_dispatch() Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 06/13] drm/panic: Pass global module parameters to drm_panic_dispatch() Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 07/13] drm/panic: Retry in dispatch function if panic output fails Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 08/13] drm/panic: Split draw_panic_plane() Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 09/13] drm/panic: Restrict to primary planes; unconditionally unregister Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 10/13] drm/panic: Display panic screen via per-plane callback Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 11/13] drm/panic: Internalize panic locking in DRM core and helpers Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 12/13] drm/panic: Move panic display code into helper library Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 13/13] drm/panic: Compile KUnit tests as module 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=20260824125201.218863-2-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert@linux-m68k.org \
    --cc=imx@lists.linux.dev \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=jfalempe@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=rdunlap@infradead.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=simona@ffwll.ch \
    --cc=stable@vger.kernel.org \
    --cc=virtualization@lists.linux.dev \
    /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