Skip to content

doc: RAND(7): a restore from a saved image is not detected; reseed after it - #33285

Closed
KurathSec wants to merge 1 commit into
openssl:masterfrom
KurathSec:stutter-rand-doc
Closed

KurathSec wants to merge 1 commit into
openssl:masterfrom
KurathSec:stutter-rand-doc

Conversation

@KurathSec

Copy link
Copy Markdown
Contributor

RAND(7) describes the automatic reseeding of the default DRBGs and says nothing about what
happens when the process, or the virtual machine it runs in, is restored from a saved image. The
DRBGs reseed on a change of process ID, on the request count and on the time interval; a restore
from a snapshot or a checkpoint changes none of these, so every copy restored from one image
continues from the generator state in the image and produces the same output until the next
scheduled reseed.

This adds one paragraph to RAND(7), after the paragraph on automatic reseeding, that states this
and tells applications running where such a restore can happen to reseed after their own restore
signal, naming RAND_poll(3) as the call that does it (it reseeds the primary DRBG; the public and
private DRBGs reseed from it at their next request).

Measured on 3.5.9 and on master, two continuations of one QEMU or Firecracker snapshot, or of one
CRIU checkpoint, compared block by block at equal sequence numbers: RAND_bytes identical in 32 of
32 blocks (QEMU with and without a vmgenid device, QEMU with a VMClock device, Firecracker with
VMGenID and VMClock attached) and 14 of 14 under CRIU, until the primary DRBG's interval expires;
plain fork, _Fork and clone are distinct through the pid check. The OpenSSL team confirmed by mail
that detecting a restore is currently a non-goal and that a documentation change stating the
current behaviour would be accepted and backported to the active stable releases; this is that
change. A separate pull request offers the detection itself as a new feature.

Checklist
  • documentation is added or updated

Copilot AI balanced review requested due to automatic review settings October 20, 2026 15:23
@openssl-cla-check openssl-cla-check Bot added the hold: cla required The contributor needs to submit a license agreement. label Oct 20, 2026
@openssl-ci-bot openssl-ci-bot Bot added the approval: review pending This pull request needs review by a committer label Oct 20, 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 reached their quota limit.

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.

…ter it

The DRBGs reseed on a change of process ID, on the request count and on
the time interval, and have no way to notice that the process or the
machine was restored from a snapshot or a checkpoint: copies restored
from one image continue from the same state until their next scheduled
reseed. Say so in RAND(7) beside the paragraph on automatic reseeding,
and tell applications in such environments to reseed after their own
restore signal, with RAND_poll(3) as the call that does it.

Measured on 3.5.9 and master: two continuations of one QEMU or
Firecracker snapshot, or of one CRIU checkpoint, print identical
RAND_bytes output block for block (32 of 32, 14 of 14) until the primary
DRBG's interval expires; plain fork, _Fork and clone are distinct through
the pid check.

Assisted-by: Claude Code:claude-fable-5-1
@t8m t8m closed this Oct 21, 2026
@t8m t8m reopened this Oct 21, 2026
@t8m

t8m commented Oct 21, 2026

Copy link
Copy Markdown
Member

@KurathSec I am not sure why the CLA check fails here and passes with the other PR. Have you used a different commit author e-mail wit the other PR?

@t8m t8m added branch: master Applies to master branch resolved: wont fix The issue has been confirmed but won't be fixed triaged: documentation The issue/pr deals with documentation (errors) tests: exempted The PR is exempt from requirements for testing tests: deferred Tests will be added in a subsequent PR (label should be removed when the PR with tests is merged) branch: 3.4 Applies to openssl-3.4 (EOL) branch: 3.5 Applies to openssl-3.5 branch: 3.6 Applies to openssl-3.6 (EOL) branch: 4.0 Applies to openssl-4.0 branch: 4.1 Applies to openssl-4.1 and removed resolved: wont fix The issue has been confirmed but won't be fixed tests: deferred Tests will be added in a subsequent PR (label should be removed when the PR with tests is merged) labels Oct 21, 2026
@t8m
t8m requested a review from a team October 21, 2026 16:05
@KurathSec

Copy link
Copy Markdown
Contributor Author

Both PRs actually use the exact same commit author email ([email protected]).

The check failed here because this PR was opened on Oct 20 before my CLA registration had fully synced in the system (the CI check reported CLA missing: [email protected] at that time). In PR #33286, a second commit was pushed on Oct 21 after the CLA was recorded, which re-triggered the check and passed (CLA found).

Because no new commits were pushed to #33285 since then, the CLA check status has simply remained in its initial failed state.

Since you have already approved this commit, could the cla-check be re-triggered from your side, or would you prefer that I do an amended force-push to re-trigger it?

@openssl-cla-check openssl-cla-check Bot removed the hold: cla required The contributor needs to submit a license agreement. label Oct 21, 2026
@openssl-ci-bot openssl-ci-bot Bot added approval: done This pull request has the required number of approvals approval: ready to merge The 24 hour grace period has passed, ready to merge and removed approval: review pending This pull request needs review by a committer approval: done This pull request has the required number of approvals labels Oct 22, 2026
@openssl-ci-bot

Copy link
Copy Markdown

This pull request is ready to merge

@t8m t8m removed the branch: 3.4 Applies to openssl-3.4 (EOL) label Oct 23, 2026
openssl-machine pushed a commit that referenced this pull request Oct 23, 2026
…ter it

The DRBGs reseed on a change of process ID, on the request count and on
the time interval, and have no way to notice that the process or the
machine was restored from a snapshot or a checkpoint: copies restored
from one image continue from the same state until their next scheduled
reseed. Say so in RAND(7) beside the paragraph on automatic reseeding,
and tell applications in such environments to reseed after their own
restore signal, with RAND_poll(3) as the call that does it.

Measured on 3.5.9 and master: two continuations of one QEMU or
Firecracker snapshot, or of one CRIU checkpoint, print identical
RAND_bytes output block for block (32 of 32, 14 of 14) until the primary
DRBG's interval expires; plain fork, _Fork and clone are distinct through
the pid check.

Assisted-by: Claude Code:claude-fable-5-1
Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Viktor Dukhovni <[email protected]>
Merge-date: Fri Oct 23 12:51:55 2026
Merged-from: #33285
openssl-machine pushed a commit that referenced this pull request Oct 23, 2026
…ter it

The DRBGs reseed on a change of process ID, on the request count and on
the time interval, and have no way to notice that the process or the
machine was restored from a snapshot or a checkpoint: copies restored
from one image continue from the same state until their next scheduled
reseed. Say so in RAND(7) beside the paragraph on automatic reseeding,
and tell applications in such environments to reseed after their own
restore signal, with RAND_poll(3) as the call that does it.

Measured on 3.5.9 and master: two continuations of one QEMU or
Firecracker snapshot, or of one CRIU checkpoint, print identical
RAND_bytes output block for block (32 of 32, 14 of 14) until the primary
DRBG's interval expires; plain fork, _Fork and clone are distinct through
the pid check.

Assisted-by: Claude Code:claude-fable-5-1
Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Viktor Dukhovni <[email protected]>
Merge-date: Fri Oct 23 12:51:55 2026
Merged-from: #33285
(cherry picked from commit f4ada04)
@t8m

t8m commented Oct 23, 2026

Copy link
Copy Markdown
Member

Merged to all the active branches. Thank you.

@t8m t8m closed this Oct 23, 2026
openssl-machine pushed a commit that referenced this pull request Oct 23, 2026
…ter it

The DRBGs reseed on a change of process ID, on the request count and on
the time interval, and have no way to notice that the process or the
machine was restored from a snapshot or a checkpoint: copies restored
from one image continue from the same state until their next scheduled
reseed. Say so in RAND(7) beside the paragraph on automatic reseeding,
and tell applications in such environments to reseed after their own
restore signal, with RAND_poll(3) as the call that does it.

Measured on 3.5.9 and master: two continuations of one QEMU or
Firecracker snapshot, or of one CRIU checkpoint, print identical
RAND_bytes output block for block (32 of 32, 14 of 14) until the primary
DRBG's interval expires; plain fork, _Fork and clone are distinct through
the pid check.

Assisted-by: Claude Code:claude-fable-5-1
Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Viktor Dukhovni <[email protected]>
Merge-date: Fri Oct 23 12:51:55 2026
Merged-from: #33285
(cherry picked from commit f4ada04)
openssl-machine pushed a commit that referenced this pull request Oct 23, 2026
…ter it

The DRBGs reseed on a change of process ID, on the request count and on
the time interval, and have no way to notice that the process or the
machine was restored from a snapshot or a checkpoint: copies restored
from one image continue from the same state until their next scheduled
reseed. Say so in RAND(7) beside the paragraph on automatic reseeding,
and tell applications in such environments to reseed after their own
restore signal, with RAND_poll(3) as the call that does it.

Measured on 3.5.9 and master: two continuations of one QEMU or
Firecracker snapshot, or of one CRIU checkpoint, print identical
RAND_bytes output block for block (32 of 32, 14 of 14) until the primary
DRBG's interval expires; plain fork, _Fork and clone are distinct through
the pid check.

Assisted-by: Claude Code:claude-fable-5-1
Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Viktor Dukhovni <[email protected]>
Merge-date: Fri Oct 23 12:51:55 2026
Merged-from: #33285
(cherry picked from commit f4ada04)
openssl-machine pushed a commit that referenced this pull request Oct 23, 2026
…ter it

The DRBGs reseed on a change of process ID, on the request count and on
the time interval, and have no way to notice that the process or the
machine was restored from a snapshot or a checkpoint: copies restored
from one image continue from the same state until their next scheduled
reseed. Say so in RAND(7) beside the paragraph on automatic reseeding,
and tell applications in such environments to reseed after their own
restore signal, with RAND_poll(3) as the call that does it.

Measured on 3.5.9 and master: two continuations of one QEMU or
Firecracker snapshot, or of one CRIU checkpoint, print identical
RAND_bytes output block for block (32 of 32, 14 of 14) until the primary
DRBG's interval expires; plain fork, _Fork and clone are distinct through
the pid check.

Assisted-by: Claude Code:claude-fable-5-1
Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Viktor Dukhovni <[email protected]>
Merge-date: Fri Oct 23 12:51:55 2026
Merged-from: #33285
(cherry picked from commit f4ada04)
Regex0000 pushed a commit to Regex0000/openssl that referenced this pull request Nov 11, 2026
…ter it

The DRBGs reseed on a change of process ID, on the request count and on
the time interval, and have no way to notice that the process or the
machine was restored from a snapshot or a checkpoint: copies restored
from one image continue from the same state until their next scheduled
reseed. Say so in RAND(7) beside the paragraph on automatic reseeding,
and tell applications in such environments to reseed after their own
restore signal, with RAND_poll(3) as the call that does it.

Measured on 3.5.9 and master: two continuations of one QEMU or
Firecracker snapshot, or of one CRIU checkpoint, print identical
RAND_bytes output block for block (32 of 32, 14 of 14) until the primary
DRBG's interval expires; plain fork, _Fork and clone are distinct through
the pid check.

Assisted-by: Claude Code:claude-fable-5-1
Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Viktor Dukhovni <[email protected]>
Merge-date: Fri Oct 23 12:51:55 2026
Merged-from: openssl#33285
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: 3.6 Applies to openssl-3.6 (EOL) 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.

5 participants