Closed
Bug 1301381
(CVE-2016-9897)
Opened 8 years ago
Closed 8 years ago
Memory corruption @ libGLESv2!rx::VaryingPacking::isFree
Categories
(Core :: Graphics: CanvasWebGL, defect)
Tracking
()
People
(Reporter: aral.yaman, Assigned: eflores)
Details
(Keywords: csectype-bounds, reporter-external, sec-high, Whiteboard: [adv-main50.1+][adv-esr45.6+])
Attachments
(3 files)
1.19 KB,
text/html
|
Details | |
5.88 KB,
text/plain
|
Details | |
1.31 KB,
patch
|
jgilbert
:
review+
gchang
:
approval-mozilla-aurora+
gchang
:
approval-mozilla-beta+
ritu
:
approval-mozilla-release+
gchang
:
approval-mozilla-esr45+
abillings
:
sec-approval+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0
Build ID: 20160907030427
Steps to reproduce:
Open crash.html
Actual results:
Firefox crashes after 1-2 sec.
The reason is when using vector constructor with varying array:
precision mediump float;
varying vec4 niqqki[100];
void main() {
vec4 (niqqki[0]);
}
This could be a security issue ?
Expected results:
No crash or compiler error.
Reporter | ||
Comment 1•8 years ago
|
||
Comment 2•8 years ago
|
||
:jgilbert, am I right in thinking this is something you would know more about?
Group: firefox-core-security → core-security
Component: Untriaged → Canvas: WebGL
Flags: needinfo?(jgilbert)
Product: Firefox → Core
Comment 3•8 years ago
|
||
There's also a ton of intermittent jemalloc heap corruption crashes on treeherder right now (see the blocks blocking bug 1301453).
Comment 4•8 years ago
|
||
IIRC we get this library from Google. Is Chrome affected? Is our version outdated?
Group: core-security → gfx-core-security
Reporter | ||
Comment 5•8 years ago
|
||
libGLES is a part from the angle project from Google -> https://github.com/google/angle
I was not able to crash chrome.
I also compared the code from the angle projet and the mozilla code:
https://github.com/google/angle/blob/bc4c4bc5f6659f3dc815b6b1d0c68ad8ab80eea2/src/libANGLE/renderer/d3d/VaryingPacking.cpp
https://hg.mozilla.org/mozilla-unified/annotate/91c2b9d5c135/gfx/angle/src/libANGLE/renderer/d3d/VaryingPacking.cpp#l185
Maybe there is an difference in a other part of the code ...
I also commited a crash report :
https://crash-stats.mozilla.com/report/index/531464b5-7dae-42d2-b7b9-2e7392160908
Updated•8 years ago
|
Flags: needinfo?(milan)
Comment 6•8 years ago
|
||
Jeff, it looks like you were the last one to update Angle. Can you figure out what the next step is for this bug? Thanks.
Flags: needinfo?(jmuizelaar)
(In reply to Andrew McCreight [:mccr8] from comment #6)
> Jeff, it looks like you were the last one to update Angle. Can you figure
> out what the next step is for this bug? Thanks.
It crashes (Windows) with the latest ANGLE as well (we had an updated, and this is still a problem.) On OS X, no crash and an error/warning:
Error: WebGL: Drawing without vertex attrib 0 array enabled forces the browser to do expensive emulation work when running on desktop OpenGL platforms, for example on Mac. It is preferable to always draw with vertex attrib 0 array enabled, by using bindAttribLocation to bind some always-used attribute to location 0.
Assignee: nobody → edwin
Flags: needinfo?(milan)
Flags: needinfo?(jmuizelaar)
Flags: needinfo?(jgilbert)
We trigger this assertion in VaryingPacking::isFree - ASSERT(registerRow + row < mRegisterMap.size());
Updated•8 years ago
|
OS: Unspecified → Windows
(In reply to Milan Sreckovic [:milan] from comment #8)
> We trigger this assertion in VaryingPacking::isFree - ASSERT(registerRow +
> row < mRegisterMap.size());
With varyingRows set to 100 and mRegisterMap sized 30.
Updated•8 years ago
|
Assignee | ||
Updated•8 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 10•8 years ago
|
||
Interesting. Chrome just refuses to use the shader, printing "useProgram: program not valid" to the console. We may be failing to catch an error from ANGLE somewhere.
Assignee | ||
Comment 11•8 years ago
|
||
That's with a release build, though, which probably has this assert compiled out. We reject the shader in the same way.
We probably just have to add a check for this at [1].
[1] https://dxr.mozilla.org/mozilla-central/source/gfx/angle/src/libANGLE/renderer/d3d/VaryingPacking.cpp#74
Assignee | ||
Comment 12•8 years ago
|
||
(In reply to Edwin Flores [:eflores] [:edwin] from comment #11)
> We probably just have to add a check for this at [1].
This works, but just trying to find whether it belongs somewhere else. Parser looks like a 'no', since it doesn't know about ContextState. Maybe in the compiler. Trying to understand the compiler code now.
Updated•8 years ago
|
status-firefox51:
--- → affected
status-firefox52:
--- → affected
tracking-firefox51:
--- → +
tracking-firefox52:
--- → +
Assignee | ||
Comment 13•8 years ago
|
||
Attachment #8803840 -
Flags: review?(jmuizelaar)
Updated•8 years ago
|
Attachment #8803840 -
Flags: review?(jmuizelaar) → review?(jgilbert)
Comment 14•8 years ago
|
||
Comment on attachment 8803840 [details] [diff] [review]
1301381.patch
Review of attachment 8803840 [details] [diff] [review]:
-----------------------------------------------------------------
This is fine, and we should upstream this.
Attachment #8803840 -
Flags: review?(jgilbert) → review+
Reporter | ||
Comment 15•8 years ago
|
||
Is this patch going to be in the next release ?
Comment 16•8 years ago
|
||
(In reply to Aral from comment #15)
> Is this patch going to be in the next release ?
No. If it is was, the status flag for 50 would be marked "Fixed" and also this bug should be resolved. This patch isn't even checked in and the release goes out on Tuesday. It would have to have been checked in weeks ago.
Updated•8 years ago
|
status-firefox50:
--- → wontfix
status-firefox-esr45:
--- → ?
Assignee | ||
Comment 17•8 years ago
|
||
Comment on attachment 8803840 [details] [diff] [review]
1301381.patch
[Security approval request comment]
How easily could an exploit be constructed based on the patch?
Not very. Looks fairly benign.
Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?
No.
Which older supported branches are affected by this flaw?
All.
If not all supported branches, which bug introduced the flaw?
-
Do you have backports for the affected branches? If not, how different, hard to create, and risky will they be?
Should apply cleanly.
How likely is this patch to cause regressions; how much testing does it need?
Very low risk of regression.
Attachment #8803840 -
Flags: sec-approval?
Comment 18•8 years ago
|
||
Comment on attachment 8803840 [details] [diff] [review]
1301381.patch
sec-approval+ for trunk. We should backport to other affected versions as well.
Attachment #8803840 -
Flags: sec-approval? → sec-approval+
Updated•8 years ago
|
Assignee | ||
Comment 19•8 years ago
|
||
Comment 20•8 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Comment 21•8 years ago
|
||
Hi :edwin,
could you please nominate this uplift to Beta51 and Aurora52?
Flags: needinfo?(edwin)
Assignee | ||
Comment 22•8 years ago
|
||
Comment on attachment 8803840 [details] [diff] [review]
1301381.patch
Approval Request Comment
[Feature/regressing bug #]: ANGLE.
[User impact if declined]: Crashes from malicious or poor use of WebGL.
[Describe test coverage new/current, TreeHerder]: On m-c.
[Risks and why]: Very low. Just adds a bounds check.
[String/UUID change made/needed]: None.
Flags: needinfo?(edwin)
Attachment #8803840 -
Flags: approval-mozilla-beta?
Attachment #8803840 -
Flags: approval-mozilla-aurora?
Comment 23•8 years ago
|
||
Comment on attachment 8803840 [details] [diff] [review]
1301381.patch
Fix a sec-high. Beta51+ and Aurora52+. Should be in 51 beta 2.
Attachment #8803840 -
Flags: approval-mozilla-beta?
Attachment #8803840 -
Flags: approval-mozilla-beta+
Attachment #8803840 -
Flags: approval-mozilla-aurora?
Attachment #8803840 -
Flags: approval-mozilla-aurora+
Comment 24•8 years ago
|
||
Comment 25•8 years ago
|
||
Attachment #8803840 -
Flags: approval-mozilla-esr45?
Comment 26•8 years ago
|
||
Updated•8 years ago
|
Attachment #8803840 -
Flags: approval-mozilla-esr45? → approval-mozilla-esr45+
Updated•8 years ago
|
Group: gfx-core-security → core-security-release
Comment 27•8 years ago
|
||
Temporarily reverted from esr45 for reasons. No action needed on your part, this'll be relanded at the appropriate time.
https://hg.mozilla.org/releases/mozilla-esr45/rev/f2792b829193
Comment 28•8 years ago
|
||
[Tracking Requested - why for this release]:
Comment 29•8 years ago
|
||
Comment on attachment 8803840 [details] [diff] [review]
1301381.patch
Low-risk sec-high with a simple patch. Also, this was already landed on ESR45 for the 45.6 release, so I think that makes this more important to ship with 50.1 as well.
Attachment #8803840 -
Flags: approval-mozilla-release?
Updated•8 years ago
|
Comment 30•8 years ago
|
||
Comment on attachment 8803840 [details] [diff] [review]
1301381.patch
Sec-high, meets the triage bar for inclusion in 50.1.0
Attachment #8803840 -
Flags: approval-mozilla-release? → approval-mozilla-release+
Comment 32•8 years ago
|
||
Updated•8 years ago
|
Flags: qe-verify+
Comment 33•8 years ago
|
||
Can't write a 50.1 advisory for this because it will 0day ESR45 users. ESR45 doesn't ship again until late January. This should not have gone into 50.1 for this reason.
Flags: needinfo?(abillings)
Comment 34•8 years ago
|
||
Ok. There is a 45.6 ESR release at the same time as 50.1. The advisory for this should be in the release.
Flags: needinfo?(abillings)
Whiteboard: [adv-main50.1+][adv-esr45.6+]
Updated•8 years ago
|
Alias: CVE-2016-9897
Reporter | ||
Updated•8 years ago
|
Flags: sec-bounty?
Comment 35•8 years ago
|
||
I've reproduced the bug on an affected build - 50.0 (20161104212021) - using the test case from Comment 0 on Windows 10 x64.
The issue is now confirmed fixed on Windows 10 x64, across the following versions:
- 45.6.0esr-build1 (20161209150850)
- 50.1.0-build2 (20161208153507)
- 51.0b7-build1 (20161212025550)
The following version is *still affected* though:
- 52.0a2 (2016-12-13)
* crash report: bp-b391865f-e695-403c-8224-a2dc62161213
- 53.0a1 (2016-12-13)
* crash report: bp-4a1afa00-e71a-4357-931c-d67bc2161213
Edwin, Jeff -- any thoughts on what might be going on for 52 and 53?
Flags: needinfo?(jgilbert)
Flags: needinfo?(edwin.bugs)
Updated•8 years ago
|
Flags: sec-bounty? → sec-bounty+
Comment 36•8 years ago
|
||
Aral: in the future please email security@mozilla.org to request security bug bounty consideration rather than setting the field yourself. We use that field to represent status that's kept elsewhere and setting the flag doesn't necessarily catch our attention.
Reporter | ||
Comment 37•8 years ago
|
||
Ok I didn't know that.
Sorry about that.
Comment 38•8 years ago
|
||
We took an ANGLE update which reverted this fix, since it wasn't upstreamed.
We'll need to reland.
Status: RESOLVED → REOPENED
Flags: needinfo?(jgilbert)
Resolution: FIXED → ---
Updated•8 years ago
|
Keywords: checkin-needed
Comment 39•8 years ago
|
||
I'll get this upstreamed.
Updated•8 years ago
|
Flags: needinfo?(jgilbert)
Comment 40•8 years ago
|
||
Keywords: checkin-needed
Whiteboard: [adv-main50.1+][adv-esr45.6+] → [adv-main50.1+][adv-esr45.6+][checkin-needed-aurora][checkin-needed-beta]
Comment 41•8 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/53b1b7c121a7
https://hg.mozilla.org/releases/mozilla-aurora/rev/9a9493b68208
https://hg.mozilla.org/releases/mozilla-beta/rev/ebdc66fc1d6f
Status: REOPENED → RESOLVED
Closed: 8 years ago → 8 years ago
Flags: needinfo?(edwin.bugs)
Resolution: --- → FIXED
Whiteboard: [adv-main50.1+][adv-esr45.6+][checkin-needed-aurora][checkin-needed-beta] → [adv-main50.1+][adv-esr45.6+]
Updated•8 years ago
|
Comment 42•8 years ago
|
||
Following up on Comment 35, this is now verified fixed on Windows 10 x64, using:
- 51.0-build2 (20170118123726)
- 52.0a2 (2017-01-19)
- 53.0a1 (2017-01-19)
- 45.7esr-build1 (20170118123525)
Status: RESOLVED → VERIFIED
Updated•8 years ago
|
Group: core-security-release
Comment 43•8 years ago
|
||
Flags: needinfo?(jgilbert)
Updated•9 months ago
|
Keywords: reporter-external
You need to log in
before you can comment on or make changes to this bug.
Description
•