Turbofan violates Liftoff's assumption of zero-extended 32-bit values in 64-bit registers |
|||||||||
Issue descriptionOn x64, Liftoff makes the assumption that 32-bit values held in 64-bit registers are always zero extended. With debug code, we check that invariant at loads, stores and i64-to-i32 conversions. The invariant is maintained within Liftoff code. I just hit a bug in the pspdfkit benchmark (https://pspdfkit.com/webassembly-benchmark/), where we wrongly report a wasm OOB memory access. This happens because Turbofan sometimes passes 32-bit arguments that are not zero-extended. In order to fix this and protect against future instances of the same bug, I see three action items here: 1) Fix the bug, with two options ((a) is my preference): a) Fix it in Turbofan, ensure that 32-bit values are always zero-extended if passed as argument in a 64-bit register. b) Fix it in Liftoff by sanitizing all 32-bit parameters. 2) Extend the fuzzer(s) to test mixed Turbofan/Liftoff execution. We currently only test both in isolation. 3) Fix the wasm trap handler such that only accesses within 8GB of a wasm memory start are caught; other accesses should be reported as SEGV. This bug tracks AI (1). I will open separate bugs for (2) and (3). This bug has high severity, as it allows read and write access to arbitrary accesses. Low impact though, as Liftoff is only enabled in M69, so it did not hit beta or stable yet. Making this an M69 beta blocker; we should be able to fix this within a few days.
,
Jul 12
,
Jul 12
,
Jul 12
clemensh: can you set OS labels please? Thanks!
,
Jul 12
Sure! This only affects x64, but on all platforms.
,
Jul 12
Meant to say: All operating systems.
,
Jul 12
This is definitely not a bug in Turbofan; Turbofan has always had the convention that the high 32 bits of Word32 values in 64 bit registers are arbitrary. This is well tested code with quite some infrastructure to make this fit together, including optimizations that elide zero-extensions for 32-to-64 bit conversions if possible. I would prefer not to change this in Turbofan.
,
Jul 12
M69 branch is coming VERY soon on July 19th, Your bug is marked as ReleaseBlock-Beta for M69. Please try to land the fix ASAP to trunk in order to prevent many merges going after M69 branch. This will also help us to branch M69 from high quality trunk. Thank you.
,
Jul 16
,
Jul 17
,
Jul 18
,
Jul 27
Both fixes did indeed make it to 69, thanks!
,
Oct 24
This bug has been closed for more than 14 weeks. Removing security view restrictions. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot |
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by clemensh@chromium.org
, Jul 12