New issue
Advanced search Search tips

Issue 810199 link

Starred by 1 user

Issue metadata

Status: Verified
Owner: ----
Closed: Oct 18
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 3
Type: Bug



Sign in to add a comment

Integer-overflow in FindNearestLegacyFontSize<int>

Project Member Reported by ClusterFuzz, Feb 8 2018

Issue description

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

Fuzzer: ifratric-browserfuzzer-v3
Job Type: linux_ubsan_chrome
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  FindNearestLegacyFontSize<int>
  blink::FontSizeFunctions::LegacyFontSize
  blink::LegacyFontSizeFromCSSValue
  
Sanitizer: undefined (UBSAN)

Regressed: https://clusterfuzz.com/revisions?job=linux_ubsan_chrome&range=370022:370027

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

Issue filed automatically.

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

Comment 1 by ClusterFuzz, Feb 8 2018

Components: Blink>CSS 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.

Comment 2 by nainar@google.com, Feb 8 2018

Owner: e...@chromium.org
Status: Assigned (was: Untriaged)
As per triage process assigning to TL. Also rerunning fuzzer task to get a regression CL

Comment 3 by yosin@chromium.org, Feb 8 2018

Components: -Blink>CSS -Blink>Editing Blink>Editing>Command
Labels: -Pri-2 OS-Android OS-Chrome OS-Mac OS-Windows Pri-3
Owner: ----
Status: Available (was: Assigned)
Route to editing because FindNearestLegacyFontSize<int> used only in editing/
and it should not use |int| as font size.

Caused by font: calc(2147483648em)/calc(-32769px)
2147483648 = 0x80000000

We should change |int pixel_font_size| to |float pixel_font_size| in following code:

int LegacyFontSizeFromCSSValue(Document* document,
                               const CSSValue* value,
                               bool is_monospace_font,
                               LegacyFontSizeMode mode) {
....
      int pixel_font_size =
          clampTo<int>(primitive_value.GetDoubleValue() * conversion);
      int legacy_font_size = FontSizeFunctions::LegacyFontSize(
          document, pixel_font_size, is_monospace_font);

and change FontSizeFunctions::LegacyFontSize() to take |float pixel_font_size|.
Project Member

Comment 4 by ClusterFuzz, Oct 18

ClusterFuzz has detected this issue as fixed in range 600341:600342.

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

Fuzzer: ifratric-browserfuzzer-v3
Job Type: linux_ubsan_chrome
Platform Id: linux

Crash Type: Integer-overflow
Crash Address: 
Crash State:
  FindNearestLegacyFontSize<int>
  blink::FontSizeFunctions::LegacyFontSize
  blink::LegacyFontSizeFromCSSValue
  
Sanitizer: undefined (UBSAN)

Regressed: https://clusterfuzz.com/revisions?job=linux_ubsan_chrome&range=370022:370027
Fixed: https://clusterfuzz.com/revisions?job=linux_ubsan_chrome&range=600341:600342

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

See https://github.com/google/clusterfuzz-tools 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 5 by ClusterFuzz, Oct 18

Labels: ClusterFuzz-Verified
Status: Verified (was: Available)
ClusterFuzz testcase 5133136909041664 is verified as fixed, so closing issue as verified.

If this is incorrect, please add ClusterFuzz-Wrong label and re-open the issue.

Sign in to add a comment