New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 788529 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

TextInputController::SetMarkedText() should take uint32_t instead of int32_t for offsets

Project Member Reported by ClusterFuzz, Nov 26 2017

Issue description

Detailed report: https://clusterfuzz.com/testcase?key=6643073915551744

Fuzzer: mbarbella_js_mutation_layout
Job Type: linux_msan_content_shell_drt
Platform Id: linux

Crash Type: Abrt
Crash Address: 0x03e900000001
Crash State:
  blink::TextIteratorAlgorithm<blink::EditingAlgorithm<blink::NodeTraversal> >::Te
  blink::DocumentMarkerController::AddMarkerInternal
  blink::DocumentMarkerController::AddCompositionMarker
  
Sanitizer: memory (MSAN)

Regressed: https://clusterfuzz.com/revisions?job=linux_msan_content_shell_drt&range=518240:518474

Reproducer Testcase: https://clusterfuzz.com/download?testcase_id=6643073915551744

Issue filed automatically.

See https://github.com/google/clusterfuzz-tools for more information.
 
Project Member

Comment 1 by ClusterFuzz, Nov 26 2017

Components: Blink>Editing
Labels: Test-Predator-Auto-Components
Automatically applying components based on crash stacktrace and information from OWNERS files.

If this is incorrect, please apply the Test-Predator-Wrong-Components label.
Project Member

Comment 2 by ClusterFuzz, Nov 26 2017

Cc: loonyb...@chromium.org dgozman@chromium.org
Labels: Test-Predator-Auto-CC
Automatically adding ccs based on suspected regression changelists:

JS exposure of feature policy by loonybear@chromium.org - https://chromium.googlesource.com/chromium/src/+/f4bdf01c99906c9f59d8e6ea4993562860ab7d3d

Extract FrameSelection::ComputeAbsoluteBounds method by dgozman@chromium.org - https://chromium.googlesource.com/chromium/src/+/76dd5a9c6f723b56973cc79608f0fe6ce446a956

If this is incorrect, please apply the Test-Predator-Wrong-CLs label.
Cc: changwan@chromium.org rlanday@chromium.org
Pasting the test case here for reference:

<input id="test" type="text">
<script>
test.focus();
textInputController.insertText('4');
textInputController.setMarkedText('4294967284', -1, -2147483648);
</script>

The test case attempts to create a PlainTextRange with start offset > end offset due to integer overflow.

It seems too ad-hoc if we just patch the crash site to handle integer overflow. Do we have any more general approach?

Comment 4 by yosin@chromium.org, Dec 6 2017

Labels: -Pri-1 Pri-3
Status: Available (was: Untriaged)
Lower to Pri-3 since this is testing API issue.

We should change TextInputControllerBindings::SetMarkedText(const std::string& text, int start, ine length) to take uint32_t to throw an exception for negative number.

See gin/converter.cc

bool Converter<uint32_t>::FromV8(Isolate* isolate,
                                 Local<Value> val,
                                 uint32_t* out) {
  if (!val->IsUint32())
    return false;
  *out = val.As<Uint32>()->Value();
  return true;
}


Note: offset in DOM is specified as "unsigned long" == uint64_t, but Blink use
|unsigned|==uint32_t.

Comment 5 by yosin@chromium.org, Dec 6 2017

Summary: TextInputController::SetMarkedText() should take uint32_t instead of int32_t for offsets (was: Abrt in blink::TextIteratorAlgorithm<blink::EditingAlgorithm<blink::NodeTraversal> >::Te)
Project Member

Comment 6 by sheriffbot@chromium.org, Dec 6

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)

Sign in to add a comment