Skip to content

Some direct memory accesses lack bounds-checks #1007

Closed
@RalfJung

Description

@RalfJung

The Allocation APIs should generally be avoided as they are low-level building blocks and don't do bounds or alignment checks themselves. I did an audit and noticed some uses crept in recently that are not properly checked:

  • getcwd
  • read
  • write

This can lead to ICEs. When these are fixed, a test should be added.

Cc @christianpoveda @oli-obk

It would be even better if we could stop exposing Memory::get and Memory::get_mut from librustc_mir... once these issues are fixed and the current wave of PRs is in (I suggested to @christianpoveda to add a write_bytes API anyway), we could try to make a concerted effort to remove the remaining uses in Miri.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-shimsArea: This affects the external function shimsC-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions