Closed Bug 2065986 Opened 19 days ago Closed 11 hours ago

Make JIT Bailout compatible with CET Shadow Stack on x86_64

Categories

(Core :: JavaScript Engine: JIT, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: abhishekcs, Assigned: abhishekcs)

References

(Blocks 2 open bugs)

Details

Attachments

(3 files)

The bailout code currently rebuilds Baseline stack frames and copies them directly into the native stack in the bailout tail. However, when CET Shadow Stack is enabled - the return addresses within these newly materialized frames are absent from the shadow stack and cause a violation. The bailout process needs to be modified to use actual call instructions when rebuilding these frames to be compatible with CET Shadow Stack.

Blocks: 1902244

Add bailout stubs to the Baseline Interpreter and the Fallback IC compiler. These
are currently a no-op - but will be jumped to by the bailout tail after copying
a single frame's contents. This allows the frame's return address, that is presently
directly copied into the stack, to be materialized with an actual call - making
bailout compatible with CET shadow stack.

Assignee: nobody → abhishekcs
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

The BaselineStackBuilder now adds BailoutStubInfo corresponding to each
rebuilt stack frame to the BaselineBailoutInfo. The stub info tells the
bailout tail where each frame's contents end and the bailout stub that
will materialize the frame's return address.

The bailout process is modified in x86_64 to use bailout stub information
to rebuild the stack one frame at a time instead of the existing bulk copy.

  • The bailout tail uses the bailout stub information to setup the bailout
    registers, copy contents of frames (besides the return address) and jumps
    to the appropriate bailout stub.
  • The bailout stub is setup so that simply calling back into the bailout
    tail materializes the expected return address - and the bailout tail can
    continue with the next frame.
Severity: -- → N/A
Priority: -- → P3
Attachment #9629951 - Attachment description: Bug 2065986 - pt2. Add bailout stub information to the BaselineBailoutInfo on x64 r=jandem!,iain! → Bug 2065986 - pt2. Add bailout stub information to the BaselineBailoutInfo r=jandem!,iain!
Attachment #9629952 - Attachment description: Bug 2065986 - pt3. Use bailout stub info to reconstruct stack on x86_64 r=jandem!,iain! → Bug 2065986 - pt3. Use bailout stub info to reconstruct stack r=jandem!,iain!
Blocks: 2071108
Status: ASSIGNED → RESOLVED
Closed: 11 hours ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: