Skip to content

PEND: drivers: entropy: ti_lpf3_radio_noise: select ENTROPY_NEEDS_PRNG - #263

Merged
soumya-TI merged 1 commit into
TexasInstruments:v4.4.0-ti-nextfrom
vmyklebust:fix/lpf3-entropy-needs-prng
Dec 3, 2026
Merged

soumya-TI merged 1 commit into
TexasInstruments:v4.4.0-ti-nextfrom
vmyklebust:fix/lpf3-entropy-needs-prng

Conversation

@vmyklebust

Copy link
Copy Markdown

The LPF3 radio noise entropy driver fills a fixed pool at boot and cannot provide more entropy after that, so it has to select ENTROPY_NEEDS_PRNG. PSA then uses the legacy RNG (entropy + HMAC_DRBG) and reads the driver only to seed it.

This config was accidentally removed in 6123556

The LPF3 radio noise entropy driver fills a fixed pool at boot and
cannot provide more entropy after that, so it has to select
ENTROPY_NEEDS_PRNG. PSA then uses the legacy RNG (entropy + HMAC_DRBG)
and reads the driver only to seed it.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Vebjorn Myklebust <v.myklebust@ti.com>
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

✅ Board tests passed

Commit a091d1e672a5

Board Build Test Jenkins build Logs
am13e230 SUCCESS SUCCESS #18-am13e230- log.html · build.log
mspm0l2228 SUCCESS SUCCESS #19-mspm0l2228- log.html · build.log
mspm33c321a SUCCESS SUCCESS #19-mspm33c321a- log.html · build.log
am62l SUCCESS SUCCESS #26-am62l- log.html · build.log
mspm0g3519 SUCCESS SUCCESS #18-mspm0g3519- log.html · build.log

All board logs (log.html and build.log) in one download: board-logs (kept 14 days)

Jenkins build: Zephyr_Board_CI #23 · Workflow run

@vmyklebust
vmyklebust marked this pull request as ready for review December 3, 2026 14:11
@vmyklebust
vmyklebust requested a review from a team December 3, 2026 14:11
@qodo-code-review

qodo-code-review Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

drivers: entropy: ti_lpf3_radio_noise: select ENTROPY_NEEDS_PRNG

🐞 Bug fix ⚙️ Configuration changes 🕐 Less than 5 minutes

Grey Divider

AI Description

• Restores the ENTROPY_NEEDS_PRNG select accidentally dropped from the LPF3 RNG config.
• Makes PSA use the legacy entropy + HMAC_DRBG PRNG, seeded by this driver.
Merge Risk 🟡 Medium

Blast radius 🟡 Medium 💥 2 capabilities

  • 2 affected capabilities within one bounded functional scope: LPF3 randomness and cryptographic-random integration.
  • The changed Kconfig symbol selects the system RNG choice for the LPF3 entropy configuration.
  • Xoshiro is seeded through the same LPF3 entropy device, so this is one end-to-end random-generation behavior rather than separate driver and PRNG capabilities.
  • PSA cryptographic random generation is a distinct security-facing outcome within the same bounded LPF3 randomness integration.
  • The Kconfig contract changes which PSA RNG implementation is selected when this entropy source cannot provide bulk data.
Sources

drivers/entropy/Kconfig.ti_lpf3_radio_noise[6-12]

config ENTROPY_TI_LPF3_RADIO_NOISE_RNG
	bool "TI SimpleLink LPF3 radio noise based Random Number Generator (RNG)"
	select ENTROPY_HAS_DRIVER
	select ENTROPY_NEEDS_PRNG
	default y
	depends on DT_HAS_TI_LPF3_RNG_ENABLED
	depends on RCL_DRIVER

drivers/entropy/Kconfig[68-72]

config ENTROPY_NEEDS_PRNG
	bool
	help
	  Promptless option to signal that the entropy driver is not capable
	  of providing large amount of data in a relatively short amount of time.
Behavioral complexity 🟡 Medium 🧩 Compatibility cases, Interacting branches

  • Before: the LPF3 driver selected ENTROPY_HAS_DRIVER without declaring limited throughput, allowing the generic direct-entropy default and external PSA RNG default.
  • After: it also selects ENTROPY_NEEDS_PRNG, selecting Xoshiro for system random and the legacy PSA RNG default.
  • New correctness condition: the startup-only entropy source must seed the selected PRNG/DRBG before consumers depend on it, while avoiding direct repeated reads that the driver cannot satisfy.
  • The Xoshiro implementation and entropy health checks are existing infrastructure; the changed interaction is the Kconfig compatibility between source capability and downstream generator choices.
Sources

drivers/entropy/Kconfig.ti_lpf3_radio_noise[6-12]

config ENTROPY_TI_LPF3_RADIO_NOISE_RNG
	bool "TI SimpleLink LPF3 radio noise based Random Number Generator (RNG)"
	select ENTROPY_HAS_DRIVER
	select ENTROPY_NEEDS_PRNG
	default y
	depends on DT_HAS_TI_LPF3_RNG_ENABLED
	depends on RCL_DRIVER
Potential damage 🟡 Medium 🩹 Recoverable

  • If the selected system RNG path regresses, callers can receive unavailable or unsuitable random values.
  • The intended path seeds Xoshiro once from the startup-only entropy source; reverting the configuration restores the prior selection, with no persistent state or external effect identified.
  • Code/configuration rollback restores the selection.
  • Xoshiro initialization has an existing cycle-based fallback when entropy is unavailable, so the quality impact of that fallback would require runtime diagnosis rather than automatic repair.
Assessed commit a091d1e
High-Level Assessment

The Kconfig select is the standard way to declare that a driver needs the PRNG wrapper, so this is the right mechanism. The alternatives were to make the driver continuously replenish its pool, which would require hardware-specific work and is out of scope for a fix, or to have PSA special-case this driver by name, which would bypass the existing Kconfig dependency model. Neither is better than restoring the select.

Files changed (1) +1 / -0

Bug fix (1) +1 / -0
Kconfig.ti_lpf3_radio_noiseRe-add ENTROPY_NEEDS_PRNG select to LPF3 radio noise RNG +1/-0

Re-add ENTROPY_NEEDS_PRNG select to LPF3 radio noise RNG

• Adds 'select ENTROPY_NEEDS_PRNG' to ENTROPY_TI_LPF3_RADIO_NOISE_RNG. The driver fills a fixed entropy pool at boot and cannot supply more afterward, so PSA must fall back to the legacy entropy + HMAC_DRBG PRNG, which reads this driver only to seed itself. The line was removed by an earlier change and is restored here.

drivers/entropy/Kconfig.ti_lpf3_radio_noise

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo


View medium (1)
Remediation recommended
1. Crypto RNG may fail once the one-shot entropy pool is spent 🐞
Description
The select ENTROPY_NEEDS_PRNG makes PSA use the legacy entropy plus HMAC_DRBG path, whose DRBG
re-polls its entropy source on each reseed, but the TI LPF3 radio-noise driver can only produce
entropy during boot. Once the DRBG's reseed interval is reached after boot, the entropy poll hits
the spent driver, so the reseed fails and PSA random generation can start returning errors on
long-running devices.
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The LPF3 radio-noise entropy driver is one-shot: after boot, entropy_get_entropy() fails. Selecting ENTROPY_NEEDS_PRNG routes PSA through the legacy HMAC_DRBG, which reseeds by polling the entropy source, so reseeds after boot can fail.

## Fix Focus Areas
- drivers/entropy/Kconfig.ti_lpf3_radio_noise[7-14]
- modules/mbedtls/zephyr_entropy.c[10-76]
- boards/ti/lpf3_common/Kconfig.defconfig[88-102]

## Recommended Fix
Verify the legacy DRBG reseed interval and its entropy polling for this target. Either ensure the reseed path never reaches the spent driver (for example by making the DRBG reseed from a continuous source), or document the limit and add a test that runs past the reseed interval after boot.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


@soumya-TI
soumya-TI merged commit 2e98bce into TexasInstruments:v4.4.0-ti-next Dec 3, 2026
14 checks passed
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.

4 participants