Crashes, Hangs and Crazy Images by Adding Zero: Fuzzing OpenGL Shader Compilers
medium.com
medium.com
As far as I can tell, Apple has set a new record for how quickly you can go from the best OpenGL drivers in the industry to the worst.
It's not only bugs, it's the lack of features. It's out of date, to the point that companies are no longer releasing games. For instance, Frontier has an Elite: Dangerous version for the Mac. It doesn't have the expansions, due to the lack of compute shaders, which are not supported by Apple's crappy OpenGL implementation.
Not that Macs are good gaming machines. But this only compounds the problem.
Except without the market share in high end gaming/graphics that made D3D viable.
I wish they would realize that the people they're hurting with this decision are not their competitors (who are actually probably happy to see them underinvest in good GL drivers) but rather us developers, who do have to develop cross-platform apps for market share reasons and so end up shouldering the costs of needless fragmentation.
The myth that Apple writes their own drivers for non-Apple GPUs is absolutely untrue, and I am amazed that it is so widespread when there is very little justification for it.
Apple's involvement with the graphics stack is about the same amount as Microsoft's. They provide the common APIs and the OS support, but the hardware is the vendor's responsibility.
There was precisely one moment in time when this was at least a third true: When Intel had subpar GPUs and offensively bad drivers. Since then, the work has transitioned back to Intel.
Nvidia writes the drivers for the Nvidia GPUs. AMD writes the drivers for the AMD GPUs.
Why are their drivers horrendously bad? Well, for Nvidia, Apple is such an increasingly small market that there is very little financial incentive for Nvidia to care. For AMD, there is slightly more of a reason to care because any market is a good market for them, and I speculate that this is a large part of the reason we've seen fewer and fewer Nvidia cards in Apple products: Apple can get AMD to care, but not Nvidia. When you only use non-Intel or non-Apple GPUs in a very tiny percentage of your products, it's hard to justify paying a ton of money out to incentivize a vendor to care.
There is very little reason why AMD or Nvidia or even Intel would share enough details about their recent hardware with a company that is becoming increasingly self-sufficient.
There are plenty of feedback loops at play here, and plenty enough reasons to see why non-Apple graphics drivers on Apple platforms would be poor. I can't for the life of me see why the assumption that Apple is writing these drivers would make sense.
Shader compiler bugs are pretty serious, but they should have exploit mitigation. It takes GLSL or SPIR-V as input and emits GPU machine code blobs, the compiler doesn't need any special privileges. It's just a big attack surface.
I am not familiar with the details of GPUs, but it would not suprise me if arbitrary code execution on a GPU can lead to root access on the main CPU. Anyone know if there is any protections against this (or if it is architectually impossible)?
I can imagine the potential for a combined CPU-GPU exploit, but it's not likely to hinge on a shader. I wouldn't say absolutely "impossible" but if I was looking for GPU exploits, I'd poke at the compiler and API first.
Disclaimer: The article author was both a lecturer and supervisor to me during my undergraduate degree, but I was in no way involved in the work discussed in the article.
EDIT: Followup post is here: https://medium.com/@afd_icl/first-stop-amd-bluescreen-via-we...
Microsoft talked about the dangers of this back then. https://blogs.technet.microsoft.com/srd/2011/06/16/webgl-con...