Skip to content

-Crelocation-model=rwpi (and possibly others) are unsound due to affecting the ABI #131300

Open
@RalfJung

Description

This is based on the discussion here; I don't understand much of the underlying technical details unfortunately.

It seems like setting -Crelocation-model=rwpi on an ARM target compiles code in a way that it expects a particular register to be reserved for data addressing. However, the standard library is not built with that in mind and can use the register for other purposes. That's clearly unsound, we can now get arbitrary misbehavior because the same register is used in conflicting ways.

Metadata

Assignees

No one assigned

    Labels

    I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessO-AArch64Armv8-A or later processors in AArch64 modeO-ArmTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 stateP-mediumMedium priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions