]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/virtio: bound EDID block reads to the response buffer
authorBryam Vargas <hexlabsecurity@proton.me>
Sun, 21 Jun 2026 02:43:34 +0000 (21:43 -0500)
committerDmitry Osipenko <dmitry.osipenko@collabora.com>
Tue, 30 Jun 2026 13:04:27 +0000 (16:04 +0300)
commit4e1a53892ba7f8a3e1da6bfc53c83ae7c812dccd
tree27c8628b299558d85f384849afd424e716e4b876
parent64ace85a725957e2359785d2a22cd285eec966de
drm/virtio: bound EDID block reads to the response buffer

virtio_get_edid_block() validates the read offset only against the
device-supplied resp->size field, never against the fixed-size resp->edid
array. The EDID block index is driven by the device-supplied extension
count, so a malicious virtio-gpu backend can advertise a large size
together with a high block count and read far past the array into adjacent
kernel memory, which is then surfaced in the parsed EDID (an out-of-bounds
read / info leak).

Also reject any read whose end exceeds the size of the edid array.
Conforming EDID responses stay within the array and are unaffected.

Fixes: b4b01b4995fb ("drm/virtio: add edid support")
Cc: stable@vger.kernel.org
Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patch.msgid.link/20260620-b4-disp-22bba7bf-v1-1-b95924cee742@proton.me
drivers/gpu/drm/virtio/virtgpu_vq.c