Skip to content

Ensure that HACL* states are not read concurrently #155835

Closed

Description

@picnixz

Bug report

Bug description:

Sometimes, it's possible to read an HACL* state concurrently:

  • sha3 reads the live HACL state outside the object lock at six sites
  • blake2's digest_size getter reads the live HACL state outside the lock

Instead, we can (1) add this static information just after construction (2) compute it inside the lock sections. The problem is that HACL* update() functions update the entire state so reading static information is unsafe.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Activity

  1. self-assigned this
    on Aug 15, 2026
  2. added 4 commits that reference this issue on Aug 15, 2026
  3. added 2 commits that reference this issue on Sep 6, 2026
  4. added 2 commits that reference this issue on Sep 12, 2026
  5. added a commit that references this issue on Sep 29, 2026
  6. added a commit that references this issue on Oct 12, 2026
  7. added a commit that references this issue on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

extension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions