New issue
Advanced search Search tips

Issue 628106 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug



Sign in to add a comment

map->instance_type() == JS_REGEXP_TYPE || map->instance_type() == JS_OBJECT_TYPE

Project Member Reported by ClusterFuzz, Jul 14 2016

Issue description

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=6649885789257728

Fuzzer: ifratric_pdf_generic
Job Type: linux_asan_pdfium
Platform Id: linux

Crash Type: CHECK failure
Crash Address: 
Crash State:
  map->instance_type() == JS_REGEXP_TYPE || map->instance_type() == JS_OBJECT_TYPE
  
Regressed: https://cluster-fuzz.appspot.com/revisions?job=linux_asan_pdfium&range=300095:300119

Minimized Testcase (502.35 Kb): https://cluster-fuzz.appspot.com/download/AMIfv94XMBshb7Tfaj6-kPtE-IPaK4uZmni6fBNTRyPw7_-CuA29CUz8wMV9Uel_xoLKWV9aFmJPEhaivvWeA4B5wQNuqZsFFHEyWQGTZpEsCOwjvhGv9KeJle1dwR0HHvv0DLvB6LuWyFHPwURitrRYhhkI1xBKt7-AaMy2JZgINIPtYvw6tBk?testcase_id=6649885789257728

Filer: nyerramilli

See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information.
 
Cc: nyerramilli@chromium.org
Labels: findit-wrong Te-Logged M-52
Owner: mythria@chromium.org
Status: Assigned (was: Available)
providing findit results for internal purpose:

Suspected CLs	Findit failed to find any stack trace. Is it in a new format?

seeing some changes to heap.c in 
https://chromium.googlesource.com/v8/v8/+/b83dbf65028431030b56e1095f94d766e1d0febc

mythria@, Could you please take a look at the issue and assign it to concerned developer if your changes are not responsible?
Cc: jochen@chromium.org
The Heap::CopyJSObject fails when it tries to copy an object whose map->instance_type() is JS_VALUE_TYPE. Unlikely that my changes could have caused this problem. cc'ing jochen who might know the code better.  

Comment 3 by jochen@chromium.org, Jul 14 2016

Cc: thestig@chromium.org mythria@chromium.org
Owner: tsepez@chromium.org
Object::Clone doesn't work for arbitrary objects - PDFium should make sure to not attempt to copy arbitrary things, but just things it knows are safe to copy

Comment 4 by tsepez@chromium.org, Jul 14 2016

Cc: tsepez@chromium.org
Would it be too much to ask to have a IsSafeToClone() method in v8::Object given the above constraint so that PDFium doesn't have to guess about v8's restrictions?

Comment 5 by jochen@chromium.org, Jul 14 2016

How would you use such an API? Would you have some other way to copy as a fallback? Could we just use that fallback always?

Comment 6 by tsepez@chromium.org, Jul 14 2016

I'm assuming its a weird corner case, so I'd just throw an error.

Comment 7 by jochen@chromium.org, Jul 14 2016

Actually, it's more like a weird corner case when this API actually works, and this check is supposed to just protect against the most obvious bugs.

I'm trying to remove the API from v8 but we still need it for performance reasons in blink :(

Comment 8 by jochen@chromium.org, Jul 14 2016

https://bugs.chromium.org/p/chromium/issues/detail?id=454595 supposedly fixed this back when this was initially reported.

Comment 9 by tsepez@chromium.org, Jul 14 2016

the fix to  bug 454595  just avoided one path that hit this.  This looks to be a different path.
Ok, so I'm left wondering why we're cloning it at all instead of just creating another handle.  Can you give me info on why one would want to do this in the first place?
I guess because of wrong assumptions of what the API does? :)

It's a shallow copy which we added for Blink so it would cache the result of creating new DOM wrappers from FunctionTemplates, and then just clone them out of a boilerplate cache.

Meanwhile, v8 also has such a cache internally, but it's a bit slower than blinks, so we can't yet delete blink's cache.

Shallow copy means that you get a new object, but it shares the prototype and everything else with the cloned object.
Project Member

Comment 13 by bugdroid1@chromium.org, Jul 19 2016

Project Member

Comment 14 by ClusterFuzz, Jul 20 2016

ClusterFuzz has detected this issue as fixed in range 406033:406232.

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=6649885789257728

Fuzzer: ifratric_pdf_generic
Job Type: linux_asan_pdfium
Platform Id: linux

Crash Type: CHECK failure
Crash Address: 
Crash State:
  map->instance_type() == JS_REGEXP_TYPE || map->instance_type() == JS_OBJECT_TYPE
  
Regressed: https://cluster-fuzz.appspot.com/revisions?job=linux_asan_pdfium&range=300095:300119
Fixed: https://cluster-fuzz.appspot.com/revisions?job=linux_asan_pdfium&range=406033:406232

Minimized Testcase (502.35 Kb): https://cluster-fuzz.appspot.com/download/AMIfv94XMBshb7Tfaj6-kPtE-IPaK4uZmni6fBNTRyPw7_-CuA29CUz8wMV9Uel_xoLKWV9aFmJPEhaivvWeA4B5wQNuqZsFFHEyWQGTZpEsCOwjvhGv9KeJle1dwR0HHvv0DLvB6LuWyFHPwURitrRYhhkI1xBKt7-AaMy2JZgINIPtYvw6tBk?testcase_id=6649885789257728

See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information.

If you suspect that the result above is incorrect, try re-doing that job on the test case report page.
Project Member

Comment 15 by sheriffbot@chromium.org, Nov 22 2016

Labels: -Restrict-View-EditIssue
Removing EditIssue view restrictions from ClusterFuzz filed bugs. If you believe that this issue should still be restricted, please reapply the label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Components: Internals>Plugins>PDF

Sign in to add a comment