User: Password:
|
|
Subscribe / Log in / New account

WebGL vulnerabilities

WebGL vulnerabilities

Posted May 26, 2011 12:59 UTC (Thu) by Cyberax (✭ supporter ✭, #52523)
In reply to: WebGL vulnerabilities by bjacob
Parent article: WebGL vulnerabilities

>This sentence is wrong on several different levels, since WebGL shaders (contrary to desktop OpenGL shaders) are not Turing-complete, they run on the GPU where there is no such thing as "kernel mode", and in case they were instead talking about the shader compilers, these certainly don't run in kernel mode.

Well, command submission to GPU is performed in the kernel mode. And it contains quite a bit of non-trivial code (relocation handling, the whole GEM/TTM stack, etc.). Additionally, as far as I understand, closed-source drivers really have shader compilers in the kernel mode.


(Log in to post comments)

WebGL vulnerabilities

Posted May 26, 2011 13:20 UTC (Thu) by bjacob (subscriber, #58566) [Link]

Come on, the kernel mode driver is considerably less complex than the user mode part, and doesn't care about the details of what shaders do. And I've never seen a driver where the shader compiler was in kernel mode. Certainly not on Windows since the shader compiler is a DLL, D3DCompiler_43.dll; not on Mac either since I've seen lots of Firefox crash reports in the shader compiler showing that the compiler runs in the application process; and I *think* I've also seen such reports for the NVIDIA binary driver on linux too (plus, the NVIDIA linux kernel-mode driver is tiny and open-source and clearly doesn't have a shader compiler). So I really don't know any example of a kernel-mode shader compiler.

WebGL vulnerabilities

Posted May 26, 2011 14:08 UTC (Thu) by mjg59 (subscriber, #23239) [Link]

The open source part of the nvidia kernel driver is tiny. The driver itself is 13MB, which is sufficiently larger than my actual kernel that I think "tiny" really isn't the word.

WebGL vulnerabilities

Posted May 26, 2011 14:23 UTC (Thu) by bjacob (subscriber, #58566) [Link]

I stand corrected:

$ ls -l `find /lib/modules/ -name nvidia.ko`
-rw-r--r-- 1 root root 14827598 Apr 1 23:33 /lib/modules/2.6.32-5-amd64/nvidia/nvidia.ko

So do you think that NVIDIA's linux driver has a shader compiler in the kernel mode part?

Is there any reason why they would want to do that, as opposed to running the compiler in user mode?

WebGL vulnerabilities

Posted May 26, 2011 14:29 UTC (Thu) by bjacob (subscriber, #58566) [Link]

`nm nvidia.ko` doesn't show anything about 'compile' or 'shader', but there are definitely lots of cryptic symbol names like _nv025298rm, no idea what they do.

WebGL vulnerabilities

Posted May 26, 2011 16:53 UTC (Thu) by Cyberax (✭ supporter ✭, #52523) [Link]

Up to DX10 Windows graphics drivers worked totally in the kernel mode, without any usermode helpers (you can check it). So NVidia did have kernelmode compiler.

I guess that they just ported Windows code to Linux without rearchitecting it. They might have moved parts of the compiler to usermode, but there's still a huge amount of code in the kernel.

WebGL vulnerabilities

Posted Jun 10, 2011 1:36 UTC (Fri) by johntb86 (subscriber, #53897) [Link]

D3D Shader bytecode->gpu code compilation happens in kernel mode (session space) for XP and below. For Vista and above all shader compilation, even for D3D9, happens in usermode inside the process that created the shader. OpenGL shader compilation happens in usermode on every platform.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds