Skip to content

Unsoundness in buffer APIs #6267

Description

@Person-93

The slice accessors of PyBuffer return &core::cell::Cell (or &ReadOnlyCell) to guard memory which might be written by other threads, but Cell's guarantee is upheld by the fact that it's not Sync and no other threads can access that memory.
https://github.com/rust-lang/rust/blob/8ab9fdff5a91b9f2b5ed57fb0275452d9a0d0280/library/core/src/cell.rs#L322-L328

It looks like the slice accessors may have relied on the GIL for soundness.

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