Skip to content

[security] library user MUST able to forbid bypassing miri #145232

@loynoir

Description

@loynoir

Recently, I encounter UB, which makes me take UB very very seriously.

Under release mode, same X, both X == 0 and X != 0 are triggered

Which makes me migrate away from all UB dependencies except hard dependency.

I do see bypassing miri, which still makes me very very concerned.

    #[cfg(all(XXX, not(miri)))]
    ...
    #[cfg(any(not(XXX), miri))]
    ...

I think, the security design should be

  • library developer MAY able to bypass miri

  • library user MUST able to forbid bypassing miri

cargo miri test --forbid-reachable-bypassing-miri --forbid-unreachable-bypassing-miri

When branch XXX is reachable, --forbid-reachable-bypassing-miri

  • If not(miri) and miri have different behavior, should be fatal.

When branch XXX is unreachable, --forbid-unreachable-bypassing-miri

  • If not(miri) and miri have different behavior, should be fatal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions