Closed Bug 1252952 Opened 8 years ago Closed 8 years ago

graphite2: UBSan value outside the range of representable values of type 'unsigned int' [@graphite2::Slot::clusterMetric]

Categories

(Core :: Graphics: Text, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
firefox45 --- disabled
firefox46 --- fixed
firefox47 --- fixed
firefox48 --- fixed
firefox-esr38 46+ disabled
firefox-esr45 46+ disabled

People

(Reporter: tsmith, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: sec-audit, testcase, Whiteboard: [gfx-noted])

Attachments

(1 file)

57.49 KB, application/x-font-ttf
Details
Attached file test_case.ttf
This was found while fuzzing graphite2 latest revision (bc5409c573aa9ecccacd18cf713021272998cd35)

This issue was uncovered using Undefined Behavior Sanitizer (UBSan). More information can be found here: http://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html.

NOTE: Bug 1252943 blocks uncovering this issue.

This is likely not a sec issue however I am hiding this bug because of the large number of bugs that have been found and I would like to avoid any unwanted attention until things calm down.

To reproduce:
Build with UBSan enabled.
run: ./gr2fonttest test_case.ttf -auto

/home/user/code/graphite/src/Slot.cpp:176:36: runtime error: value -137 is outside the range of representable values of type 'unsigned int'
    #0 0x7fb3ce4a5d6a in graphite2::Slot::clusterMetric(graphite2::Segment const*, unsigned char, unsigned char, bool) /home/user/code/graphite/src/Slot.cpp:176:36
    #1 0x7fb3ce2927df in graphite2::Segment::getGlyphMetric(graphite2::Slot*, unsigned char, unsigned char, bool) const /home/user/code/graphite/src/inc/Segment.h:222:16
    #2 0x7fb3ce27df0e in (anonymous namespace)::push_glyph_metric(unsigned char const*&, int*&, int*, regbank&) /home/user/code/graphite/src/inc/opcodes.h:464:9
    #3 0x7fb3ce2622b0 in graphite2::vm::Machine::run(void* const*, unsigned char const*, graphite2::Slot**&) /home/user/code/graphite/src/call_machine.cpp:121:12
    #4 0x7fb3ce302ff1 in graphite2::vm::Machine::Code::run(graphite2::vm::Machine&, graphite2::Slot**&) const /home/user/code/graphite/src/Code.cpp:745:13
    #5 0x7fb3ce43526f in graphite2::Pass::doAction(graphite2::vm::Machine::Code const*, graphite2::Slot*&, graphite2::vm::Machine&) const /home/user/code/graphite/src/Pass.cpp:676:17
    #6 0x7fb3ce4270af in graphite2::Pass::findNDoRule(graphite2::Slot*&, graphite2::vm::Machine&, graphite2::FiniteStateMachine&) const /home/user/code/graphite/src/Pass.cpp:545:33
    #7 0x7fb3ce421460 in graphite2::Pass::runGraphite(graphite2::vm::Machine&, graphite2::FiniteStateMachine&, bool) const /home/user/code/graphite/src/Pass.cpp:414:13
    #8 0x7fb3ce4921d6 in graphite2::Silf::runGraphite(graphite2::Segment*, unsigned char, unsigned char, int) const /home/user/code/graphite/src/Silf.cpp:423:21
    #9 0x7fb3ce388f89 in graphite2::Face::runGraphite(graphite2::Segment*, graphite2::Silf const*) const /home/user/code/graphite/src/Face.cpp:186:16
    #10 0x7fb3ce2beab5 in graphite2::Segment::runGraphite() /home/user/code/graphite/src/inc/Segment.h:97:45
    #11 0x7fb3ce2b773e in (anonymous namespace)::makeAndInitialize(graphite2::Font const*, graphite2::Face const*, unsigned int, graphite2::FeatureVal const*, gr_encform, void const*, unsigned long, int) /home/user/code/graphite/src/gr_segment.cpp:46:67
    #12 0x7fb3ce2b70fb in gr_make_seg /home/user/code/graphite/src/gr_segment.cpp:105:24
    #13 0x4f98fc in Parameters::testFileFont() const /home/user/code/graphite/gr2fonttest/gr2FontTest.cpp:684:20
    #14 0x4fd33b in main /home/user/code/graphite/gr2fonttest/gr2FontTest.cpp:787:9
    #15 0x7fb3cddf6ec4 in __libc_start_main /build/eglibc-3GlaMS/eglibc-2.19/csu/libc-start.c:287
    #16 0x41b985 in _start (/home/user/Desktop/graphite/gr2fonttest+0x41b985)
Fixed? in e7deaf90c9c8ca30116340419313af527fe90d78
Verified with graphite revision 520d76818052772d614e581dacea69499b912be6
Whiteboard: [gfx-noted]
Depends on: 1255158
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Group: gfx-core-security → core-security-release
Graphite2 has been updated on all affected branches including ESRs.
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.