Skip to content

doc: RAND(7): a fork that keeps the PID continues the generator - #33508

Closed
KurathSec wants to merge 2 commits into
openssl:masterfrom
KurathSec:rand-doc-same-pid
Closed

KurathSec wants to merge 2 commits into
openssl:masterfrom
KurathSec:rand-doc-same-pid

Conversation

@KurathSec

Copy link
Copy Markdown
Contributor

The RAND(7) paragraph from #33285 says that a child created by fork(2) does not continue its parent's generator. A child that keeps its parent's process ID does: after a process with process ID 1 calls unshare(2) with CLONE_NEWPID, the child it creates by fork(2) is process 1 of the new PID namespace, and the DRBGs' fork check compares getpid(). This adds the case to the paragraph and to the advice to reseed.

Checklist
  • documentation is added or updated

Copilot AI balanced review requested due to automatic review settings November 3, 2026 11:15
@openssl-ci-bot openssl-ci-bot Bot added the approval: review pending This pull request needs review by a committer label Nov 3, 2026
@openssl-cla-check openssl-cla-check Bot added the hold: cla required The contributor needs to submit a license agreement. label Nov 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

The DRBGs tell a child from its parent by the process ID. After a
process with process ID 1 calls unshare(2) with CLONE_NEWPID, the child
it creates by fork(2) is process 1 of the new PID namespace, so the
check sees no change and the child continues its parent's generator.
Say so beside the statement on fork(2), and tell applications that
create such a child to reseed in it, with RAND_poll(3) as the call that
does it.
@openssl-cla-check openssl-cla-check Bot removed the hold: cla required The contributor needs to submit a license agreement. label Nov 3, 2026
Comment thread doc/man7/RAND.pod Resolved
@esyr esyr added branch: master Applies to master branch triaged: documentation The issue/pr deals with documentation (errors) branch: 3.5 Applies to openssl-3.5 branch: 4.0 Applies to openssl-4.0 branch: 4.1 Applies to openssl-4.1 labels Nov 6, 2026
@openssl-ci-bot openssl-ci-bot Bot added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels Nov 9, 2026
@t8m t8m added the tests: exempted The PR is exempt from requirements for testing label Nov 9, 2026
@openssl-ci-bot openssl-ci-bot Bot added approval: ready to merge The 24 hour grace period has passed, ready to merge and removed approval: done This pull request has the required number of approvals labels Nov 10, 2026
@openssl-ci-bot

Copy link
Copy Markdown

This pull request is ready to merge

@esyr

esyr commented Nov 10, 2026

Copy link
Copy Markdown
Member

Were ML-based tools used to create non-trivial portion of this patch? If that is the case, please annotate the commit message with a suitable Assisted-by: trailer (or just mention in the comments what trailer should be included), in accordance with [1].

[1] https://openssl-library.org/policies/general/ai-policy/#how-to-declare-it

@KurathSec

Copy link
Copy Markdown
Contributor Author

Yes. Both commits were written with an AI tool: 43e5ad3 is the new paragraph, adbd3d4 applies the wording suggested in review. The trailer for both:

Assisted-by: Claude Code:claude-opus-5-5

If you would rather have it in the commit messages on the branch, I can amend and force-push; I have not done so because that would dismiss the approvals.

openssl-machine pushed a commit that referenced this pull request Nov 11, 2026
The DRBGs tell a child from its parent by the process ID.  After
a process with process ID 1 calls unshare(2) with CLONE_NEWPID,
the child it creates by fork(2) is process 1 of the new PID namespace,
so the check sees no change and the child continues its parent's
generator.  Say so beside the statement on fork(2), and tell
applications that create such a child to reseed in it,
with RAND_poll(3) as the call that does it.

Assisted-by: Claude Code:claude-opus-5-5
Reviewed-by: Eugene Syromiatnikov <[email protected]>
Reviewed-by: Nikola Pajkovsky <[email protected]>
Reviewed-by: Jakub Zelenka <[email protected]>
Merge-date: Wed Nov 11 09:07:14 2026
Merged-from: #33508
openssl-machine pushed a commit that referenced this pull request Nov 11, 2026
The DRBGs tell a child from its parent by the process ID.  After
a process with process ID 1 calls unshare(2) with CLONE_NEWPID,
the child it creates by fork(2) is process 1 of the new PID namespace,
so the check sees no change and the child continues its parent's
generator.  Say so beside the statement on fork(2), and tell
applications that create such a child to reseed in it,
with RAND_poll(3) as the call that does it.

Assisted-by: Claude Code:claude-opus-5-5
Reviewed-by: Eugene Syromiatnikov <[email protected]>
Reviewed-by: Nikola Pajkovsky <[email protected]>
Reviewed-by: Jakub Zelenka <[email protected]>
Merge-date: Wed Nov 11 09:07:14 2026
Merged-from: #33508
(cherry picked from commit dcb9027)
openssl-machine pushed a commit that referenced this pull request Nov 11, 2026
The DRBGs tell a child from its parent by the process ID.  After
a process with process ID 1 calls unshare(2) with CLONE_NEWPID,
the child it creates by fork(2) is process 1 of the new PID namespace,
so the check sees no change and the child continues its parent's
generator.  Say so beside the statement on fork(2), and tell
applications that create such a child to reseed in it,
with RAND_poll(3) as the call that does it.

Assisted-by: Claude Code:claude-opus-5-5
Reviewed-by: Eugene Syromiatnikov <[email protected]>
Reviewed-by: Nikola Pajkovsky <[email protected]>
Reviewed-by: Jakub Zelenka <[email protected]>
Merge-date: Wed Nov 11 09:07:14 2026
Merged-from: #33508
(cherry picked from commit dcb9027)
openssl-machine pushed a commit that referenced this pull request Nov 11, 2026
The DRBGs tell a child from its parent by the process ID.  After
a process with process ID 1 calls unshare(2) with CLONE_NEWPID,
the child it creates by fork(2) is process 1 of the new PID namespace,
so the check sees no change and the child continues its parent's
generator.  Say so beside the statement on fork(2), and tell
applications that create such a child to reseed in it,
with RAND_poll(3) as the call that does it.

Assisted-by: Claude Code:claude-opus-5-5
Reviewed-by: Eugene Syromiatnikov <[email protected]>
Reviewed-by: Nikola Pajkovsky <[email protected]>
Reviewed-by: Jakub Zelenka <[email protected]>
Merge-date: Wed Nov 11 09:07:14 2026
Merged-from: #33508
(cherry picked from commit dcb9027)
@esyr

esyr commented Nov 11, 2026

Copy link
Copy Markdown
Member

Applied to master, openssl-4.1, openssl-4.0, and openssl-3.5. Thank you for your contribution.

@esyr esyr closed this Nov 11, 2026
Regex0000 pushed a commit to Regex0000/openssl that referenced this pull request Nov 11, 2026
The DRBGs tell a child from its parent by the process ID.  After
a process with process ID 1 calls unshare(2) with CLONE_NEWPID,
the child it creates by fork(2) is process 1 of the new PID namespace,
so the check sees no change and the child continues its parent's
generator.  Say so beside the statement on fork(2), and tell
applications that create such a child to reseed in it,
with RAND_poll(3) as the call that does it.

Assisted-by: Claude Code:claude-opus-5-5
Reviewed-by: Eugene Syromiatnikov <[email protected]>
Reviewed-by: Nikola Pajkovsky <[email protected]>
Reviewed-by: Jakub Zelenka <[email protected]>
Merge-date: Wed Nov 11 09:07:14 2026
Merged-from: openssl#33508
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval: ready to merge The 24 hour grace period has passed, ready to merge branch: master Applies to master branch branch: 3.5 Applies to openssl-3.5 branch: 4.0 Applies to openssl-4.0 branch: 4.1 Applies to openssl-4.1 tests: exempted The PR is exempt from requirements for testing triaged: documentation The issue/pr deals with documentation (errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants