New issue
Advanced search Search tips

Issue 862929 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 17
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 1
Type: Bug-Security

Blocked on:
issue 862935
issue 862931
issue 863810
issue 864509



Sign in to add a comment

Turbofan violates Liftoff's assumption of zero-extended 32-bit values in 64-bit registers

Project Member Reported by clemensh@chromium.org, Jul 12

Issue description

On 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.
 
Blockedon: 862931
Blockedon: 862935
Project Member

Comment 3 by sheriffbot@chromium.org, Jul 12

Labels: Security_Impact-Head
clemensh: can you set OS labels please? Thanks!
Labels: OS-Linux OS-Mac OS-Windows
Sure! This only affects x64, but on all platforms.
Meant to say: All operating systems.
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.
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.
Blockedon: 863810
Blockedon: 864509
Status: Fixed (was: Assigned)
The fixes for issues  863810  and  864509  seem to be enough.
Marking fixed, but we will have to make sure that both fixes make it in the M69 branch.
Project Member

Comment 12 by sheriffbot@chromium.org, Jul 18

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify
Labels: -ReleaseBlock-Beta
Both fixes did indeed make it to 69, thanks!
Project Member

Comment 14 by sheriffbot@chromium.org, Oct 24

Labels: -Restrict-View-SecurityNotify allpublic
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