diff options
| author | Linmao Li <lilinmao@kylinos.cn> | 2026-07-21 09:15:58 +0800 |
|---|---|---|
| committer | Maíra Canal <mcanal@igalia.com> | 2026-07-21 09:53:28 -0300 |
| commit | 0c9e6367639548307d3f578f6943ce72c9d39087 (patch) | |
| tree | f4f7fb12ef262c74d30aa00d32d7c3857c645033 /scripts/stackusage | |
| parent | 67b8bfd4ec7dac6e79a7ad9ad19a7a9d6fc35a26 (diff) | |
drm/vc4: Prevent shader BO mappings from becoming writable
vc4_gem_object_mmap() rejects a writable mapping of a validated shader
BO, but leaves VM_MAYWRITE set. Userspace can map the BO read-only and
then turn it writable with mprotect().
Validated shader BOs must stay read-only: the validator checks the
instructions once and the GPU trusts them afterwards. A writable
mapping lets userspace rewrite the code after validation, bypassing the
validator.
Clear VM_MAYWRITE on the read-only path so the mapping cannot be
upgraded, as i915 already does for its read-only objects.
Fixes: 463873d57014 ("drm/vc4: Add an API for creating GPU shaders in GEM BOs.")
Cc: stable@vger.kernel.org
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/dri-devel/20260720085554.B0AF01F000E9@smtp.kernel.org/
Signed-off-by: Linmao Li <lilinmao@kylinos.cn>
Link: https://patch.msgid.link/20260721011558.1672477-1-lilinmao@kylinos.cn
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Diffstat (limited to 'scripts/stackusage')
0 files changed, 0 insertions, 0 deletions
