SHADER VALIDATOR FOR VC4.(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… Shader validator for VC4.(9)

okay so bestie, this is a page from the Kernel API Manual β€” yes, the Kernel API Manual, we're literally in the big leagues now πŸŽ€ β€” and it's all about the shader validator for VC4. sit down, hydrate, and let's get into it ✨

🌸 NAME 🌸

Shader validator for VC4. β€” the security bouncer standing between your shaders and the rest of system memory 🫢

πŸ’– DESCRIPTION πŸ’–

so here's the situation, and it's kind of a big deal 😭 the VC4 has no IOMMU between it and system memory. none. zero. not a single one πŸ’€ which means if a user has access to execute shaders, they could legitimately escalate privilege β€” like, actual privilege escalation β€” by overwriting system memory (using the VPM write address register in the general-purpose DMA mode) or by reading system memory it shouldn't be reading (reading it as a texture, as uniform data, or via a direct-addressed TMU lookup). yeah. that's the whole vibe. not cute, but it's real πŸ™ˆ

the shader validator walks over a shader's BO, making sure its accesses are appropriately bounded, and recording where texture accesses are made so that we can do relocations for them in the uniform stream. lowkey iconic bookkeeping behavior πŸ‘‘

and here's the part where it gets chill: shader BO are immutable for their lifetimes β€” enforced by not allowing mmaps, GEM prime export, or rendering to from a CL 🌈 so this validation is only performed at BO creation time. one vibe check, at the door, and that's it. periodt πŸ’…

bestie please remember: that immutability isn't a suggestion, it's enforced β€” the no-mmaps / no-GEM-prime-export / no-rendering-to-from-a-CL rules are literally what make validating once at BO creation time safe 🫢

πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./drivers/gpu/drm/vc4/vc4_validate_shaders.c β€” go read the source, iykyk πŸ“–

and that's the whole page, bestie πŸŽ€ this masterpiece lives in ./drivers/gpu/drm/vc4 and it's dated October 2026 β€” slay, see you in the source tree, mwah πŸ’–βœ¨

πŸ“¦ where this page comes from