Skip to content

drm/vc4: txp: fix writeback dimension checks and normalize rotation#7292

Open
name2965 wants to merge 1 commit intoraspberrypi:rpi-6.12.yfrom
name2965:bugfix/txp-atomic-check
Open

drm/vc4: txp: fix writeback dimension checks and normalize rotation#7292
name2965 wants to merge 1 commit intoraspberrypi:rpi-6.12.yfrom
name2965:bugfix/txp-atomic-check

Conversation

@name2965
Copy link
Copy Markdown
Contributor

If the rotation value is 0, it can be compared to an accurate bitmask, thereby bypassing size validation; furthermore, frame buffer size validation is so inadequate that it cannot reliably filter out write buffers that are too small.

This results in a DMA OOB vulnerability on Raspberry Pi models prior to the 5 that lack an IOMMU, and I have successfully reproduced this vulnerability.

I tested this immediately by installing the Raspberry Pi OS 64-bit on a Raspberry Pi 4 Model B rev 1.2 using Imager.

This issue occurs on Raspberry Pi without IOMMU, and DMA OOB can be easily reproduced in any kernel version where vulnerable code exists, in addition to the kernel version I reproduced.

repro.mp4

If the rotation value is 0, the rotation is compared to an accurate
bitmask, which can bypass the size check, and the frame buffer size
validation is too weak to reliably reject write buffers that are too
small.

Therefore, to prevent this, normalize the rotation state, modify the
size check, and reject write targets that cannot cover the programmed
output size.

Signed-off-by: Jeongjun Park <aha310510@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant