GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-135561: ensure that the GIL is held when handling an HACL* error in `_hmac` by picnixz · Pull Request #135562 · python/cpython

Conversation

@picnixz

@picnixz picnixz commented Jun 16, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

It's a bug that I discovered in #135267 but I'll first patch 3.14 and main.

cc @ZeroIntensity

  • Issue: _hmac: GIL may be released while attempting to set an exception #135561

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
picnixz added 2 commits June 16, 2025 15:02
@picnixz
fix GIL issue
e0fbcfa
@picnixz
blurb
0b2f4e4
@picnixz
picnixz requested a review from gpshead as a code owner June 16, 2025 13:04
@bedevere-app bedevere-app Bot added the awaiting core review label Jun 16, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Jun 16, 2025
_hmac: GIL may be released while attempting to set an exception #135561
Closed
@picnixz picnixz added the needs backport to 3.14 bugs and security fixes label Jun 16, 2025
@picnixz picnixz mentioned this pull request Jun 16, 2025
gh-135239: simpler use of mutex in hashlib & co #135267
Merged
ZeroIntensity
ZeroIntensity reviewed Jun 16, 2025
View reviewed changes
Comment thread Modules/hmacmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

vstinner
vstinner reviewed Jun 16, 2025
View reviewed changes
Comment thread Modules/hmacmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/hmacmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@picnixz
simplify _hacl_convert_errno
aea6888
@picnixz

picnixz commented Jun 16, 2025

Copy link
Copy Markdown
Member Author

I'm leaving in 15 mins, but I hope we can make it for the next beta release (tomorrow). This bug is not really an issue as it should never happen in practice (if it happens, then there is something fundamentally wrong)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz

picnixz commented Jun 16, 2025

Copy link
Copy Markdown
Member Author

!buildbot FIPS only

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented Jun 16, 2025

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @picnixz for commit aea6888 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F135562%2Fmerge

The command will test the builders whose names match following regular expression: FIPS only

The builders matched are:

  • AMD64 RHEL8 FIPS Only Blake2 Builtin Hash PR
  • AMD64 CentOS9 FIPS Only Blake2 Builtin Hash PR
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner
vstinner approved these changes Jun 16, 2025
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@ZeroIntensity: Are you ok with this fix?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Modules/hmacmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Jun 16, 2025
ZeroIntensity
ZeroIntensity approved these changes Jun 16, 2025
View reviewed changes

@ZeroIntensity ZeroIntensity left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this looks good to me.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@picnixz @vstinner
Update Modules/hmacmodule.c
718e620
Co-authored-by: Victor Stinner <[email protected]>
@picnixz
picnixz enabled auto-merge (squash) June 19, 2025 17:02
@picnixz
picnixz merged commit c765683 into python:main Jun 19, 2025
@miss-islington-app

miss-islington-app Bot commented Jun 19, 2025

Copy link
Copy Markdown

Thanks @picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Jun 19, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 19, 2025
@picnixz @miss-islington
pythongh-135561: ensure that the GIL is held when handling an HACL* e…
62db8bd
…rror in `_hmac` (pythonGH-135562)

(cherry picked from commit c765683)

Co-authored-by: Bénédikt Tran <[email protected]>
@bedevere-app

bedevere-app Bot commented Jun 19, 2025

Copy link
Copy Markdown

GH-135725 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jun 19, 2025
@picnixz
picnixz deleted the fix/hmac/gil-135561 branch June 19, 2025 17:29
picnixz added a commit that referenced this pull request Jun 19, 2025
@miss-islington @picnixz
[3.14] gh-135561: ensure that the GIL is held when handling an HACL* …
83e0ab1
…error in `_hmac` (GH-135562) (#135725)

gh-135561: ensure that the GIL is held when handling an HACL* error in `_hmac` (GH-135562)
(cherry picked from commit c765683)

Co-authored-by: Bénédikt Tran <[email protected]>
lkollar pushed a commit to lkollar/cpython that referenced this pull request Jun 19, 2025
@picnixz @lkollar
pythongh-135561: ensure that the GIL is held when handling an HACL* e…
2695c0d
…rror in `_hmac` (python#135562)
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
@picnixz @Pranjal095
pythongh-135561: ensure that the GIL is held when handling an HACL* e…
d6f894d
…rror in `_hmac` (python#135562)
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
@picnixz @taegyunkim
pythongh-135561: ensure that the GIL is held when handling an HACL* e…
451b4d4
…rror in `_hmac` (python#135562)
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
@picnixz @Agent-Hellboy
pythongh-135561: ensure that the GIL is held when handling an HACL* e…
b10ec29
…rror in `_hmac` (python#135562)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner approved these changes
@ZeroIntensity ZeroIntensity ZeroIntensity approved these changes
@gpshead gpshead Awaiting requested review from gpshead gpshead is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@picnixz @bedevere-bot @vstinner @ZeroIntensity
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.