drm/vc4: txp: fix writeback dimension checks and normalize rotation#7292
Open
name2965 wants to merge 1 commit intoraspberrypi:rpi-6.12.yfrom
Open
drm/vc4: txp: fix writeback dimension checks and normalize rotation#7292name2965 wants to merge 1 commit intoraspberrypi:rpi-6.12.yfrom
name2965 wants to merge 1 commit intoraspberrypi:rpi-6.12.yfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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