Skip to content
Memory corruption Disclosed report Advanced CVE-2024-2607

Assertion failure: volatileLiveRegs.has(ReturnRegVal0), at jit/arm/MacroAssembler-arm.cpp:5994

Gary Kwong Follow

Originally disclosed on Mozilla

  • Fixed in 2 days
  • Paid in 8 days
  • Disclosed after 2 days
Text
Created attachment 9379782
debug stack

'''
var x = 2;
(1).toString(x)[0];
for (var y = 0; y < 1; y++) {}
'''

'''
(gdb) bt
#0  js::jit::MacroAssembler::flexibleDivMod32 (this=0xf63bb318, rhs=..., 
    lhsOutput=..., remOutput=..., isUnsigned=<optimized out>, volatileLiveRegs=...)
    at /home/gen32gx500/trees/mozilla-central/js/src/jit/arm/MacroAssembler-arm.cpp:5994
#1  0x591f9d9e in js::jit::MacroAssembler::loadInt32ToStringWithBase (
    this=0xf63bb318, input=..., base=..., dest=..., scratch1=..., scratch2=..., 
    staticStrings=..., volatileRegs=..., lowerCase=<optimized out>, fail=0xf63d1414)
    at /home/gen32gx500/trees/mozilla-central/js/src/jit/MacroAssembler.cpp:1884
#2  0x58f9d5c7 in js::jit::CodeGenerator::visitInt32ToStringWithBase (
    this=0xf63bb300, lir=0xf63ce6d8)
    at /home/gen32gx500/trees/mozilla-central/js/src/jit/CodeGenerator.cpp:10821
#3  0x58f78f9e in js::jit::CodeGenerator::generateBody (this=0xf63bb300)
    at /home/gen32gx500/trees/mozilla-central/js/src/jit/CodeGenerator.cpp:7388
#4  0x58fdedb1 in js::jit::CodeGenerator::generate (this=0xf63bb300)
    at /home/gen32gx500/trees/mozilla-central/js/src/jit/CodeGenerator.cpp:15230
#5  0x5902ae72 in js::jit::GenerateCode (mir=0xf63ca100, lir=0xf63cda08)
    at /home/gen32gx500/trees/mozilla-central/js/src/jit/Ion.cpp:1585
#6  js::jit::CompileBackEnd (mir=0xf63ca100, snapshot=0xf63ca518)
    at /home/gen32gx500/trees/mozilla-central/js/src/jit/Ion.cpp:1614
#7  0x5902c285 in js::jit::IonCompile (cx=0xf7614100, script=..., 
    osrPc=<optimized out>)
    at /home/gen32gx500/trees/mozilla-central/js/src/jit/Ion.cpp:1736
#8  js::jit::Compile (cx=0xf7614100, script=..., osrFrame=<optimized out>, 
    osrPc=0xf7603b12 "\227\b")
    at /home/gen32gx500/trees/mozilla-central/js/src/jit/Ion.cpp:1890
#9  0x5902ce8e in BaselineCanEnterAtBranch (cx=0xf7614100, osrFrame=0xf67fff08, 
    script=..., pc=<optimized out>)
    at /home/gen32gx500/trees/mozilla-central/js/src/jit/Ion.cpp:2091
#10 IonCompileScriptForBaseline (cx=<optimized out>, frame=0xf67fff08, 
    pc=0xf7603b12 "\227\b")
    at /home/gen32gx500/trees/mozilla-central/js/src/jit/Ion.cpp:2143
#11 0x5902d7f7 in js::jit::IonCompileScriptForBaselineOSR (cx=0xf7614100, 
    frame=0xf67fff08, frameSize=48, pc=0xf7603b12 "\227\b", infoPtr=0xf67ffee8)
    at /home/gen32gx500/trees/mozilla-central/js/src/jit/Ion.cpp:2255
/snip
'''

Run with `--fuzzing-safe --no-threads --ion-eager --arm-hwcap=vfp`, compile with `PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig AR=ar 'CC="clang -msse2 -mfpmath=sse"' 'CXX="clang++ -msse2 -mfpmath=sse"' sh ../configure --host=x86_64-pc-linux-gnu --target=i686-pc-linux --enable-simulator=arm --enable-debug --enable-debug-symbols --with-ccache --enable-gczeal --enable-rust-simd --disable-tests`, tested on m-c rev 13676fc9b0cd.

This seems to regress somewhere between m-c rev fac963c3bc00 (Aug 2022) and m-c rev e963fffcb3a0 (Jun 2023) but I'm still digging more into this.

Setting s-s to be safe.

The original report as published on Mozilla's Bugzilla, by Gary Kwong. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A high-severity memory corruption bug in JavaScript Engine: JIT. Mozilla made it public on 15 February 2024 as CVE-2024-2607.

About Memory corruption

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by Gary Kwong

View all

42 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.