Heap-use-after-free in Mesa, triggerable by resizing a WebGL canvas
Originally disclosed on Mozilla
- Fixed in 3 months
- Paid in 10 months
- Disclosed after 3 months
Created attachment 661996
Testcase
Run the testcase from content/canvas/test/webgl/conformance/more/functions/ directory. Here is my OpenGL info.
OpenGL version string: 2.1 Mesa 8.0.2
Unsymbolized -
==28427== ERROR: AddressSanitizer heap-use-after-free on address 0x7f299c105380 at pc 0x4c1336 bp 0x7fff93b8a980 sp 0x7fff93b8a748
WRITE of size 1 at 0x7f299c105380 thread T0
#0 0x4c1335 (/tmp/firefox/firefox+0x4c1335)
#1 0x7f29a15438c1 (/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so+0x738c1)
0x7f299c105380 is located 0 bytes inside of 64-byte region [0x7f299c105380,0x7f299c1053c0)
freed by thread T0 here:
#0 0x4c4a10 (/tmp/firefox/firefox+0x4c4a10)
#1 0x7f29a11c4c19 (/usr/lib/x86_64-linux-gnu/dri/libdricore.so+0x155c19)
previously allocated by thread T0 here:
#0 0x4c4d4a (/tmp/firefox/firefox+0x4c4d4a)
#1 0x7f29a10f9d60 (/usr/lib/x86_64-linux-gnu/dri/libdricore.so+0x8ad60)
Shadow byte and word:
0x1fe533820a70: fd
0x1fe533820a70: fd fd fd fd fd fd fd fd
More shadow bytes:
0x1fe533820a50: fd fd fd fd fd fd fd fd
0x1fe533820a58: fd fd fd fd fd fd fd fd
0x1fe533820a60: fa fa fa fa fa fa fa fa
0x1fe533820a68: fa fa fa fa fa fa fa fa
=>0x1fe533820a70: fd fd fd fd fd fd fd fd
0x1fe533820a78: fd fd fd fd fd fd fd fd
0x1fe533820a80: fa fa fa fa fa fa fa fa
0x1fe533820a88: fa fa fa fa fa fa fa fa
0x1fe533820a90: fd fd fd fd fd fd fd fd
Stats: 214M malloced (217M for red zones) by 289321 calls
Stats: 30M realloced by 12288 calls
Stats: 174M freed by 171411 calls
Stats: 42M really freed by 47020 calls
Stats: 420M (107600 full pages) mmaped in 105 calls
mmaps by size class: 8:212979; 9:40955; 10:8190; 11:10235; 12:2048; 13:2048; 14:1536; 15:256; 16:384; 17:1312; 18:144; 19:40; 20:20;
mallocs by size class: 8:221586; 9:38394; 10:7643; 11:13561; 12:2266; 13:2004; 14:1530; 15:310; 16:504; 17:1333; 18:136; 19:37; 20:17;
frees by size class: 8:122227; 9:28108; 10:4313; 11:10535; 12:1422; 13:1409; 14:1332; 15:256; 16:443; 17:1283; 18:32; 19:36; 20:15;
rfrees by size class: 8:34255; 9:5161; 10:1300; 11:4626; 12:388; 13:372; 14:332; 15:83; 16:229; 17:263; 18:6; 19:4; 20:1;
Stats: malloc large: 1523 small slow: 1623
==28427== ABORTING
Symbolized -
==27925== ERROR: AddressSanitizer heap-use-after-free on address 0x7ff8472f3c80 at pc 0x4c1336 bp 0x7fffa43d7d20 sp 0x7fffa43d7ae8
WRITE of size 1 at 0x7ff8472f3c80 thread T0
#0 0x4c1335 in memcpy ??:?
#1 0x7ff84cf438c1 in ?? ??:0
0x7ff8472f3c80 is located 0 bytes inside of 64-byte region [0x7ff8472f3c80,0x7ff8472f3cc0)
freed by thread T0 here:
#0 0x4c4a10 in __interceptor_free ??:?
#1 0x7ff84cbc4c19 in ?? ??:0
previously allocated by thread T0 here:
#0 0x4c4d4a in __interceptor_posix_memalign ??:?
#1 0x7ff84caf9d60 in ?? ??:0
Shadow byte and word:
0x1fff08e5e790: fd
0x1fff08e5e790: fd fd fd fd fd fd fd fd
More shadow bytes:
0x1fff08e5e770: fd fd fd fd fd fd fd fd
0x1fff08e5e778: fd fd fd fd fd fd fd fd
0x1fff08e5e780: fa fa fa fa fa fa fa fa
0x1fff08e5e788: fa fa fa fa fa fa fa fa
=>0x1fff08e5e790: fd fd fd fd fd fd fd fd
0x1fff08e5e798: fd fd fd fd fd fd fd fd
0x1fff08e5e7a0: fa fa fa fa fa fa fa fa
0x1fff08e5e7a8: fa fa fa fa fa fa fa fa
0x1fff08e5e7b0: fd fd fd fd fd fd fd fd
Stats: 214M malloced (218M for red zones) by 289327 calls
Stats: 30M realloced by 12281 calls
Stats: 174M freed by 171411 calls
Stats: 42M really freed by 46444 calls
Stats: 420M (107600 full pages) mmaped in 105 calls
mmaps by size class: 8:212979; 9:40955; 10:8190; 11:10235; 12:2048; 13:2048; 14:1536; 15:256; 16:384; 17:1312; 18:144; 19:40; 20:20;
mallocs by size class: 8:221603; 9:38387; 10:7646; 11:13555; 12:2265; 13:2004; 14:1530; 15:310; 16:503; 17:1333; 18:137; 19:37; 20:17;
frees by size class: 8:122240; 9:28103; 10:4313; 11:10529; 12:1420; 13:1409; 14:1332; 15:256; 16:443; 17:1283; 18:32; 19:36; 20:15;
rfrees by size class: 8:33919; 9:5096; 10:1273; 11:4499; 12:374; 13:370; 14:328; 15:83; 16:231; 17:260; 18:6; 19:4; 20:1;
Stats: malloc large: 1524 small slow: 1614
==27925== ABORTING
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 memory corruption bug in Graphics: CanvasWebGL. Mozilla made it public on 10 December 2012 as CVE-2013-0763.
About Memory corruption
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.