Skip to content

Revert "Disable aws-lc-sys jitter entropy to avoid startup SIGABRT" - #6795

Merged
gz merged 1 commit into
mainfrom
aws-lc-rndr-armcap
Aug 4, 2026
Merged

Revert "Disable aws-lc-sys jitter entropy to avoid startup SIGABRT"#6795
gz merged 1 commit into
mainfrom
aws-lc-rndr-armcap

Conversation

@gz

@gz gz commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Reverts the AWS_LC_SYS_NO_JITTER_ENTROPY=1 build setting. The diagnosis behind
it was most likely wrong, and it does not prevent the crash it targeted.

What actually aborts

The silent SIGABRT during the first TLS handshake is aws-lc's entropy source
aborting when the arm64 RNDR instruction fails, not the CPU jitter entropy
health check.

Some Google Cloud arm64 hosts advertise FEAT_RNG via ID_AA64ISAR0_EL1.RNDR
but the instruction never returns entropy. Measured in-process on a GKE
n4a-highcpu-8 (Axion) node:

probe result
/proc/cpuinfo Features includes rng
OPENSSL_armcap_P 0x3887d, so ARMV8_RNG (bit 17) is set
rndr_multiple8(buf, 8) 0, on three consecutive calls
CRYPTO_rndr_multiple8(buf, 48) 0

aws-lc selects the hardware RNG because capability detection says it exists, then
abort()s when it fails, with no fallback and nothing written to stderr. Located
by breakpointing every branch feeding the tail-merged bl abort in
rand_bytes_impl on a live crashing process.

This is per-instance rather than per-machine-type: a sibling node of the same
type ran the same binary and workload fine, and its rndr_multiple8 returns 1.

Why disabling jitter entropy does not help

RNDR is fatal in both entropy source configurations. The flag only changes
which callback the hardware RNG backs, and therefore which abort fires:

configuration get_extra_entropy get_prediction_resistance aborts at
default, CPU jitter on entropy_os_get_extra_entropy entropy_cpu_get_prediction_resistance (RNDR) rand.c:259
NO_JITTER_ENTROPY=1 entropy_cpu_get_extra_entropy (RNDR) NULL rand.c:294

Both branch on the same have_hw_rng_aarch64(). Consistent with this, the
crashes continued after the reverted commit landed.

The upstream issue the original commit matched against (aws/aws-lc-rs#1072) is a
different failure: it aborts in tree_jitter_initialize_once on Windows, whereas
these backtraces are in rand_bytes_impl.

Mitigation

OPENSSL_armcap=~0x20000 clears ARMV8_RNG at runtime, after which both
configurations route around RNDR. Verified against the pipeline binary:

OPENSSL_armcap_P bit 17 RAND_bytes
baseline 0x3887d set 1
OPENSSL_armcap=~0x20000 0x1887d clear 1

That is a runtime setting and belongs in the deployment rather than the build, so
it is applied there instead of in this repo.

A bug report is going upstream to aws-lc asking it to fall back rather than abort
when a probed hardware RNG fails, and to retry RNDR the way the x86 path already
retries RDRAND (rdrand_multiple8 retries 10 times; rndr_multiple8 does not
retry at all, though Arm documents RNDR as permitted to fail transiently).

This reverts commit 6e8ecec.

The SIGABRT it targeted was not CPU jitter entropy. The crash is aws-lc aborting when the arm64 RNDR instruction fails: some hosts advertise FEAT_RNG via ID_AA64ISAR0_EL1.RNDR while the instruction never actually returns entropy, and aws-lc abort()s instead of falling back to a software source.

Disabling jitter entropy does not avoid that. It only changes which callback the hardware RNG backs, and so which abort fires. With CPU jitter enabled, RNDR backs get_prediction_resistance and the process aborts in rand.c:259; with it disabled, RNDR backs get_extra_entropy and it aborts in rand.c:294. Both are fatal, and the crashes continued after this commit landed.

The mitigation is OPENSSL_armcap=~0x20000, which clears ARMV8_RNG at runtime so aws-lc routes around RNDR. That belongs in the deployment rather than the build, and is applied there.

Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
@gz
gz requested a review from blp August 3, 2026 23:14
@gz
gz enabled auto-merge August 3, 2026 23:16
@gz
gz added this pull request to the merge queue Aug 3, 2026

@mythical-fred mythical-fred 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.

The commit-message writeup is the actual review here: RNDR failing is fatal in both entropy source configurations because have_hw_rng_aarch64() gates both callbacks, so the original AWS_LC_SYS_NO_JITTER_ENTROPY=1 only shifted which abort site fires. The mitigation belongs in the deployment (OPENSSL_armcap=~0x20000) rather than the build. Approving the revert.

Merged via the queue into main with commit 12c68e3 Aug 4, 2026
1 check passed
@gz
gz deleted the aws-lc-rndr-armcap branch August 4, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants