Global buffer overflow (read 4) at nsFloatManager::GetFlowArea() with multicol, list, floats
- Fixed in 3 months
- Paid in 3 months
- Disclosed after 3 months
Created attachment 763086
original testcase (aborts debug builds when resized or when many copies are loaded)
Opening several of the attached page at once causes ASan to spot a global buffer overflow in current aurora- and beta asan builds, most of the time. The read is aligned and pretty far away from adjecent objects, so filing as a potential security issue since it's not obvious we're always reading something fixed, like padding bytes, with fixed outcome.
The original even larger testcase needed just two of them to trigger this reliably. The attached somewhat reduced page still hits this most of the time. Let me know if you have trouble reproducing, because this could be related to machine speed etc.
$ opt/firefox-aurora-asan/firefox ff-gbof-getflowarea.html{,,,,,,,,,,,,,,} 2>&1 | symbolize | c++filt
=================================================================
==14198== ERROR: AddressSanitizer global-buffer-overflow on address 0x7ff38e6b69a0 at pc 0x7ff386ed8bb1 bp 0x7fff9afa6740 sp 0x7fff9afa6738
READ of size 4 at 0x7ff38e6b69a0 thread T0
#0 0x7ff386ed8bb0 in nsFloatManager::GetFlowArea(int, nsFloatManager::BandInfoType, int, nsRect, nsFloatManager::SavedState*) const /home/aki/src/mozilla-aurora/layout/generic/nsFloatManager.cpp:140
0x7ff38e6b69a0 is located 32 bytes to the left of global variable 'mozilla::sse_private::sse3_enabled (/home/aki/src/mozilla-aurora/objdir-ff-asan/xpcom/build/SSE.cpp)' (0x7ff38e6b69c0) of size 1
0x7ff38e6b69a0 is located 24 bytes to the right of global variable 'nsTArrayHeader::sEmptyHdr (/home/aki/src/mozilla-aurora/objdir-ff-asan/xpcom/build/nsTArray.cpp)' (0x7ff38e6b6980) of size 8
'nsTArrayHeader::sEmptyHdr (/home/aki/src/mozilla-aurora/objdir-ff-asan/xpcom/build/nsTArray.cpp)' is ascii string ''
Shadow byte and word:
0x1ffe71cd6d34: f9
0x1ffe71cd6d30: 00 f9 f9 f9 f9 f9 f9 f9
More shadow bytes:
0x1ffe71cd6d10: 04 f9 f9 f9 f9 f9 f9 f9
0x1ffe71cd6d18: 01 f9 f9 f9 f9 f9 f9 f9
0x1ffe71cd6d20: 04 f9 f9 f9 f9 f9 f9 f9
0x1ffe71cd6d28: 00 00 00 f9 f9 f9 f9 f9
=>0x1ffe71cd6d30: 00 f9 f9 f9 f9 f9 f9 f9
0x1ffe71cd6d38: 01 f9 f9 f9 f9 f9 f9 f9
0x1ffe71cd6d40: 01 f9 f9 f9 f9 f9 f9 f9
0x1ffe71cd6d48: 01 f9 f9 f9 f9 f9 f9 f9
0x1ffe71cd6d50: 01 f9 f9 f9 f9 f9 f9 f9
Stats: 150M malloced (212M for red zones) by 600810 calls
Stats: 12M realloced by 34962 calls
Stats: 102M freed by 265916 calls
Stats: 0M really freed by 0 calls
Stats: 400M (102447 full pages) mmaped in 100 calls
mmaps by size class: 8:524256; 9:57337; 10:24570; 11:16376; 12:4096; 13:4096; 14:1280; 15:512; 16:1152; 17:128; 18:32; 19:8; 20:4;
mallocs by size class: 8:502183; 9:54311; 10:19963; 11:14517; 12:3446; 13:3628; 14:1128; 15:394; 16:1111; 17:100; 18:17; 19:8; 20:4;
frees by size class: 8:202047; 9:33734; 10:12283; 11:11046; 12:2220; 13:2726; 14:536; 15:272; 16:944; 17:90; 18:11; 19:4; 20:3;
rfrees by size class:
Stats: malloc large: 129 small slow: 2773
==14198== 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 Layout: Floats. Mozilla made it public on 6 September 2013 as CVE-2013-1732.
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.