Skip to content

gh-146139: Disable socketpair authentication on WASI#146140

Merged
vstinner merged 3 commits intopython:mainfrom
dicej:disable-sockepair-auth-on-wasi
Apr 13, 2026
Merged

gh-146139: Disable socketpair authentication on WASI#146140
vstinner merged 3 commits intopython:mainfrom
dicej:disable-sockepair-auth-on-wasi

Conversation

@dicej
Copy link
Copy Markdown
Contributor

@dicej dicej commented Mar 18, 2026

Calling connect(2) on a non-blocking socket on WASI may leave the socket in a "connecting" but not yet "connected" state. In the former case, calling getpeername(2) on it will fail, leading to an unhandled exception in Python.

@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Mar 18, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@python-cla-bot
Copy link
Copy Markdown

python-cla-bot bot commented Mar 18, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

Copy link
Copy Markdown
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@vstinner
Copy link
Copy Markdown
Member

@dicej: You should sign the Python CLA: #146140 (comment).

@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Mar 19, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@dicej
Copy link
Copy Markdown
Contributor Author

dicej commented Mar 19, 2026

Regarding the CLA: I've asked my employer for permission to sign it and am awaiting a reply.

@vstinner
Copy link
Copy Markdown
Member

Regarding the CLA: I've asked my employer for permission to sign it and am awaiting a reply.

Any update on the CLA @dicej?

@dicej
Copy link
Copy Markdown
Contributor Author

dicej commented Mar 24, 2026

Any update on the CLA @dicej?

Yes: I need my employer to sign it as an organization to cover my contributions (i.e. I'm not supposed to sign as an individual contributor), which means using this form, but it's not clear how we should fill that out given that the signatory (i.e. the person with authority to sign for the whole organization) and the contributor(s) (e.g. me) will be different people. I sent an email to psf@python.org for clarification and was redirected to contributors@python.org, but haven't heard back yet.

Given this is effectively a one-line change modulo whitespace, it all feels like overkill, but this should unblock future contributions as well.

@brettcannon
Copy link
Copy Markdown
Member

it's not clear how we should fill that out given that the signatory (i.e. the person with authority to sign for the whole organization) and the contributor(s) (e.g. me) will be different people.

It's fine if they are different people. The key thing is if someone from Akamai is submitting for the entire org then they just need to be empowered to sign such a form to say any contributions coming from someone on work time is covered by the CLA.

@dicej
Copy link
Copy Markdown
Contributor Author

dicej commented Mar 27, 2026

I still haven't received a response from contributors@python.org. Can anyone confirm that, if an authorized party at Akamai signs the CLA form on behalf of Akamai, any contributions from a @akamai.com email address will be covered?

@vstinner
Copy link
Copy Markdown
Member

@ambv: Do you know how to proceed for the CLA in this case?

@JacobCoffee
Copy link
Copy Markdown
Member

JacobCoffee commented Apr 9, 2026

The company has to sign on the Python.org website, checking the box for signing as an organization.

The Contributor Agreement page you're looking at now is ONLY for signing Contributor Agreements on behalf of organizations.

and the individual has to sign via GitHub sign-in through https://cla.python.org/ which cover that individuals contributions

dicej and others added 2 commits April 13, 2026 07:19
Calling `connect(2)` on a non-blocking socket on WASI may leave the socket in a
"connecting" but not yet "connected" state.  In the former case, calling
`getpeername(2)` on it will fail, leading to an unhandled exception in Python.
Co-authored-by: Victor Stinner <vstinner@python.org>
@dicej dicej force-pushed the disable-sockepair-auth-on-wasi branch from eb851ef to e71d5a7 Compare April 13, 2026 13:19
@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 13, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@dicej
Copy link
Copy Markdown
Contributor Author

dicej commented Apr 13, 2026

Thanks, @JacobCoffee. The CLA is signed now.

@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 13, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@brettcannon
Copy link
Copy Markdown
Member

@dicej can you look at the failures (e.g. missing a news entry)?

@vstinner
Copy link
Copy Markdown
Member

"_RegenSbom" failed with "HTTP error 503: Service Unavailable" on Windows. I re-ran the failed (Windows) jobs.

Copy link
Copy Markdown
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

(Still) LGTM.

@vstinner
Copy link
Copy Markdown
Member

Let's skip the NEWS entry.

@vstinner vstinner enabled auto-merge (squash) April 13, 2026 20:42
@vstinner vstinner added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Apr 13, 2026
@vstinner vstinner merged commit a5b76d5 into python:main Apr 13, 2026
86 of 95 checks passed
@miss-islington-app
Copy link
Copy Markdown

Thanks @dicej for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 13, 2026
…H-146140)

Calling `connect(2)` on a non-blocking socket on WASI may leave the socket in a
"connecting" but not yet "connected" state.  In the former case, calling
`getpeername(2)` on it will fail, leading to an unhandled exception in Python.
(cherry picked from commit a5b76d53bb29afd864243f44ef22968f6385dfa0)

Co-authored-by: Joel Dice <joel.dice@akamai.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Brett Cannon <brett@python.org>
@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 13, 2026

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 13, 2026
…H-146140)

Calling `connect(2)` on a non-blocking socket on WASI may leave the socket in a
"connecting" but not yet "connected" state.  In the former case, calling
`getpeername(2)` on it will fail, leading to an unhandled exception in Python.
(cherry picked from commit a5b76d5)

Co-authored-by: Joel Dice <joel.dice@akamai.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Brett Cannon <brett@python.org>
@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Apr 13, 2026
@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 13, 2026

GH-148527 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Apr 13, 2026
@vstinner
Copy link
Copy Markdown
Member

Thanks @dicej for the fix and signing the CLA. I backported the fix to 3.13 and 3.14 branches.

vstinner added a commit that referenced this pull request Apr 13, 2026
) (#148527)

gh-146139: Disable `socketpair` authentication on WASI (GH-146140)

Calling `connect(2)` on a non-blocking socket on WASI may leave the socket in a
"connecting" but not yet "connected" state.  In the former case, calling
`getpeername(2)` on it will fail, leading to an unhandled exception in Python.
(cherry picked from commit a5b76d5)

Co-authored-by: Joel Dice <joel.dice@akamai.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Brett Cannon <brett@python.org>
vstinner added a commit that referenced this pull request Apr 13, 2026
) (#148526)

gh-146139: Disable `socketpair` authentication on WASI (GH-146140)

Calling `connect(2)` on a non-blocking socket on WASI may leave the socket in a
"connecting" but not yet "connected" state.  In the former case, calling
`getpeername(2)` on it will fail, leading to an unhandled exception in Python.
(cherry picked from commit a5b76d5)

Co-authored-by: Joel Dice <joel.dice@akamai.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Brett Cannon <brett@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants