Closed
Bug 761014
(CVE-2012-1960)
Opened 12 years ago
Closed 12 years ago
Out of bounds read in qcms_transform_data_rgb_out_lut_sse2
Categories
(Core :: Graphics: Color Management, defect)
Tracking
()
People
(Reporter: jrmuizel, Assigned: jrmuizel)
References
Details
(Keywords: regression, sec-moderate, Whiteboard: [advisory-tracking+])
Crash Data
Attachments
(2 files, 1 obsolete file)
(deleted),
text/plain
|
Details | |
(deleted),
patch
|
BenWa
:
review+
lsblakk
:
approval-mozilla-aurora+
lsblakk
:
approval-mozilla-beta+
akeybl
:
approval-mozilla-esr10+
|
Details | Diff | Splinter Review |
I received the following report from Tony Payne at Google
"The attached profiles respectively trigger SIGSEGV when looking up the output value for R, G or B when used as both the input and the output profile for test-transform.c"
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #629637 -
Flags: review?
Assignee | ||
Updated•12 years ago
|
Attachment #629637 -
Flags: review? → review?(bgirard)
Comment 2•12 years ago
|
||
If you don't crash on an AV maybe page content could try to read back gamma values to peek into random memory?
Keywords: sec-moderate
Comment 3•12 years ago
|
||
This patch does indeed avoid the crash, but causes serious problems in applying transform. Try it out against http://www.color.org/version4html.xalter, for example.
Comment 4•12 years ago
|
||
(In reply to Tony Payne from comment #3)
> This patch does indeed avoid the crash, but causes serious problems in
> applying transform. Try it out against
> http://www.color.org/version4html.xalter, for example.
Specifically, it seems that gamma == 1.f is expected and should not be forced to 0.f
Comment 5•12 years ago
|
||
From the specs:
NOTE The parameters selected for a parametric curve can result in complex or undefined values for the input range used. This can occur, for example, if d < −b/a. In such cases the behaviour of the curve is undefined.
I don't think I ever enforced this either.
Comment 6•12 years ago
|
||
Comment on attachment 629637 [details] [diff] [review]
Avoid the OOB read by sanitizing our gamma_tables
Review of attachment 629637 [details] [diff] [review]:
-----------------------------------------------------------------
::: transform_util.c
@@ +222,5 @@
> + int i;
> + for (i = 0; i < 256; i++) {
> + // Note: we check that the gamma is not in range
> + // instead of out of range so that we catch NaNs
> + if (!(gamma_table[i] > 0.f && gamma_table[i] < 1.f)) {
Tony is right, this should at the very least be <=. Before you post a new patch let me see if the values fall outside the range as specified in the specs.
Attachment #629637 -
Flags: review?(bgirard) → review-
Comment 7•12 years ago
|
||
Parametric curve in question:
type=3
Gamma=-32,765.0000
a=0.8621
b=0.1379
c=0.1107
d=0.0800
((ax+b)^g when x >= 0.8621
Comment 8•12 years ago
|
||
Correction:
Parametric curve in question:
type=3
Gamma=-32,765.0000
a=0.8621
b=0.1379
c=0.1107
d=0.0800
((ax+b)^g when x >= 0.08
((0.8621*x+0.1379)^-32,765
Graph: http://tinyurl.com/cjrohpz
Comment 9•12 years ago
|
||
Alright so we should take the patch with the fix above and a check for d < −b/a:
Section 10.16:
The domain and range of each function shall be [0,0 1,0]. Any function value outside the range shall be clipped to the range of the function.
Assignee | ||
Comment 10•12 years ago
|
||
This is a more involved approach. Instead of validating the output we just ensure that is valid at creation time.
Attachment #629637 -
Attachment is obsolete: true
Attachment #631098 -
Flags: review?(bgirard)
Updated•12 years ago
|
Attachment #631098 -
Flags: review?(bgirard) → review+
Comment 11•12 years ago
|
||
Thanks, Jeff and Benoit. Are there any plans to upstream the mozilla qcms patches to the github repo?
Assignee | ||
Comment 12•12 years ago
|
||
(In reply to Tony Payne from comment #11)
> Thanks, Jeff and Benoit. Are there any plans to upstream the mozilla qcms
> patches to the github repo?
Yes, I'll do that today.
Assignee | ||
Comment 13•12 years ago
|
||
I've landed this under bug 764181 to make the security hole less obvious.
Assignee | ||
Comment 14•12 years ago
|
||
Comment on attachment 631098 [details] [diff] [review]
Avoid the OOB by ensuring the output is always between 0..1
[Approval Request Comment]
Bug caused by (feature/regressing bug #): 674230
User impact if declined: Content controlled OOB that could leak data
Testing completed (on m-c, etc.): been on m-c for a while
Risk to taking this patch (and alternatives if risky): Very low risk
String or UUID changes made by this patch: None
Attachment #631098 -
Flags: approval-mozilla-beta?
Attachment #631098 -
Flags: approval-mozilla-aurora?
Updated•12 years ago
|
status-firefox14:
--- → affected
status-firefox15:
--- → affected
Comment 15•12 years ago
|
||
Comment on attachment 631098 [details] [diff] [review]
Avoid the OOB by ensuring the output is always between 0..1
Approving for both Aurora/Beta and setting status flags, please update once landed.
Attachment #631098 -
Flags: approval-mozilla-beta?
Attachment #631098 -
Flags: approval-mozilla-beta+
Attachment #631098 -
Flags: approval-mozilla-aurora?
Attachment #631098 -
Flags: approval-mozilla-aurora+
Assignee | ||
Comment 16•12 years ago
|
||
Assignee | ||
Updated•12 years ago
|
Comment 17•12 years ago
|
||
If this is caused by bug 674230, this should affect ESR.
Comment 18•12 years ago
|
||
Jeff - I don't think this sg:moderate bug would be a requirement to fix in the ESR released alongside FF14, but it would be great to get into that release as well if at all possible. How hard would it be to backport?
Updated•12 years ago
|
Alias: CVE-2012-1960
Updated•12 years ago
|
Comment 20•12 years ago
|
||
(In reply to Alex Keybl [:akeybl] from comment #18)
> Jeff - I don't think this sg:moderate bug would be a requirement to fix in
> the ESR released alongside FF14, but it would be great to get into that
> release as well if at all possible. How hard would it be to backport?
The patch just applies to ESR-10 without problem.
(In reply to Alex Keybl [:akeybl] from comment #19)
> What's the plan here for FF16?
According to comment #13, it is fixed in Fx 16.
status-firefox16:
--- → fixed
tracking-firefox16:
? → ---
Comment 21•12 years ago
|
||
Let's get this into the next ESR release, that ships with Firefox 15 - please nominate for ESR landing as per https://wiki.mozilla.org/Release_Management/ESR_Landing_Process
Updated•12 years ago
|
Group: core-security
Comment 22•12 years ago
|
||
Jeff - assigning to you to get ESR nomination & landing.
Assignee: nobody → jmuizelaar
Updated•12 years ago
|
Attachment #631098 -
Flags: approval-mozilla-esr10+
Updated•12 years ago
|
Keywords: checkin-needed
Comment 23•12 years ago
|
||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 24•12 years ago
|
||
I'm confused. This bug's status is set to NEW while the status flags are set to FIXED.
Updated•12 years ago
|
Crash Signature: [@ qcms_transform_data_rgb_out_lut_sse2 ]
Comment 25•12 years ago
|
||
Jeff, is this fixed and we just had the status confusion?
Flags: needinfo?(jmuizelaar)
Assignee | ||
Comment 26•12 years ago
|
||
I believe so yes.
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: needinfo?(jmuizelaar)
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•