Skip to contentSkip to conversation

Patch "drm/connector/hdmi: Fix out of bounds memory read" has been added to the 7.1-stable tree

PATCH [email protected] 1 participant 1 message Aug 20

Subsystems (2)
lore
Share & tools
lore

[email protected]

author Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

drm/connector/hdmi: Fix out of bounds memory read

to the 7.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
drm-connector-hdmi-fix-out-of-bounds-memory-read.patch
and it can be found in the queue-7.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From 9ecf8ba763d0ffe0673538eb4bf7806f20455d19 Mon Sep 17 00:00:00 2001
From: John Harrison <[email protected]>
Date: Thu, 23 Jul 2026 15:06:52 -0700
Subject: drm/connector/hdmi: Fix out of bounds memory read
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From: John Harrison <[email protected]>

commit 9ecf8ba763d0ffe0673538eb4bf7806f20455d19 upstream.

A helper function was copying a given audio infoframe into the connector's copy but using the size of the destination (a generic target, sized to accept many different data blocks) not the source (a very specific type of data block). Thus, it was copying 60 bytes of data from a 28 byte allocation.

Fix that by using the source size instead, together with a build bug on the source size actually being smaller than the destination.

I hit this running KUnit tests under KASAN (while debugging something else entirely). In the real world, it seems unlikely to cause an actual problem. It is a read not a write so it can't corrupt any memory. However, it could potentially fall off the end of a page and cause an accvio bug.

Fixes f378b77227bc ("drm/connector: hdmi: Add Infoframes generation")
Cc Ville Syrjälä <[email protected]>
Cc Dmitry Baryshkov <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc David Airlie <[email protected]>
Cc Simona Vetter <[email protected]>
Cc Dmitry Baryshkov <[email protected]>
Cc Daniel Stone <[email protected]>
Cc Nicolas Frattaroli <[email protected]>
Cc Jani Nikula <[email protected]>
Cc José Expósito <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc [email protected] # v6.11+
---
 drivers/gpu/drm/display/drm_hdmi_state_helper.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/display/drm_hdmi_state_helper.c +2 -1
@@ -1096,7 +1096,8 @@ drm_atomic_helper_connector_hdmi_update_
 
 	mutex_lock(&connector->hdmi.infoframes.lock);
 
-	memcpy(&infoframe->data, frame, sizeof(infoframe->data));
+	BUILD_BUG_ON(sizeof(*frame) > sizeof(infoframe->data));
+	memcpy(&infoframe->data, frame, sizeof(*frame));
 	infoframe->set = true;
 
 	ret = write_infoframe(connector, &funcs->audio, "Audio", infoframe);

Patches currently in stable-queue which might be from [email protected] are

queue-7.1/drm-connector-hdmi-fix-out-of-bounds-memory-read.patch