News for hackers. Stuff that matters.
Re:Planet Shadertoy by cleeus on Sunday February 25, 2018 @03:05AM (#16457791)
Remember that WebGL is also a security nightmare. Shaders are fed to the GPU driver. The driver contains a compiler and compiles the shaders into the GPU specific ISA. The GPU that runs that code is a PCIe device with full DMA access. What could possibly go wrong?

(I'm aware that at least Chrome does some syntactic checks on the shader syntax)

Re:Planet Shadertoy by twtw on Sunday February 25, 2018 @04:04AM (#16457973)
GPUs can only access pinned memory that is intentionally mapped into their address space. Also, each context gets its own virtual address space on the GPU, isolated from other contexts.

There can still be issues, but it isn't quite as much of a free for all as the above comment sounds.

Re:Planet Shadertoy by floatboth on Sunday February 25, 2018 @05:28AM (#16458237)
Fun fact, the Raspberry Pi's GPU can access everything. And to deal with that, the Mesa VC4 driver validates every shader to prevent reading other processes' stuff.
Re:Planet Shadertoy by FraKtus on Sunday February 25, 2018 @05:36AM (#16458269)
Isn't that because in that SOC they use unified memory where GPU and CPU memory is the same. This does not apply to most desktop computers or mobile phones...
Re:Planet Shadertoy by FraKtus on Sunday February 25, 2018 @03:10AM (#16457800)
Are there examples where this model has been abused to steal real data?
Re:Planet Shadertoy by jburgess777 on Sunday February 25, 2018 @09:00AM (#16458973)
A long time ago, a bug in Firefox let a screenshot be taken of data outside the browser window:

"This issue allows attackers to capture screen shots of private or confidential information"

https://blog.mozilla.org/security/2011/06/16/webgl-graphics-...

Re:Planet Shadertoy by FraKtus on Sunday February 25, 2018 @11:39AM (#16459708)
I suppose this is more about reading another texture than the one you are supposed to use. GPU memory is flat, and there is no concept of process memory up there.
Re:Planet Shadertoy by jsheard on Sunday February 25, 2018 @08:56AM (#16458955)
In the early days of WebGL some browsers leaked information via uninitialized GPU memory, so an attacker could potentially read texture data left behind by other processes.

Todays WebGL implementations take care to wipe new memory allocations with zeros before letting the untrusted script do anything with them though.

Re:Planet Shadertoy by FraKtus on Sunday February 25, 2018 @11:48AM (#16459756)
That's the same than starting a process and mallocing some memory; you will have the garbage of the previous process... Because you have no idea who owned that memory and what it was used to it would be hard to build something on top of that. This being said it's not a bad idea to zero stuff when you start to use them.
Re:Planet Shadertoy by pjmlp on Sunday February 25, 2018 @03:38AM (#16457888)
Which is why WebGL is only a subset of native GL ES and will never be as good.