Skip to content

Ensure that HACL* states are not read concurrently #155835

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

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