[Mesa-dev] [Bug 71912] New: Compounded macros in shaders: huge memory consumption

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Nov 22 03:01:13 PST 2013


https://bugs.freedesktop.org/show_bug.cgi?id=71912

          Priority: medium
            Bug ID: 71912
          Assignee: mesa-dev at lists.freedesktop.org
           Summary: Compounded macros in shaders: huge memory consumption
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: kevin.rogovin at intel.com
          Hardware: Other
            Status: NEW
           Version: 9.1
         Component: Mesa core
           Product: Mesa

Created attachment 89625
  --> https://bugs.freedesktop.org/attachment.cgi?id=89625&action=edit
Vertex shader that has deep macro

The attached shader causes literally gigabytes upon gigabytes of memory to be
consumed when submitted to Mesa. The shader cause is because it compounds
macros many levels deep. Mesa is at the stage of applying the preprocessor and
does not get to even parsing the shader, much less compiling it.

The main issue is for WebGL enabled browsers. Indeed, a malicious website could
submit such a shader (which is quite small) and bring the user's system to a
standstill halt almost.

A possible fix is to essentially add additional logic to the preprocessor
computing the complexity multiplier of a macro and if that complexity
multiplies is too high to abort with a message that macro expands into a too
large expression.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131122/a62c3abe/attachment-0001.html>


More information about the mesa-dev mailing list