Page MenuHomeFreeBSD

Fortuna: Add failpoints to simulate initial seeding conditions
ClosedPublic

Authored by cem on Sep 5 2018, 3:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 18 2024, 1:45 AM
Unknown Object (File)
Dec 22 2023, 12:57 PM
Unknown Object (File)
Dec 12 2023, 12:14 AM
Unknown Object (File)
Nov 21 2023, 4:54 PM
Unknown Object (File)
Sep 29 2023, 12:10 AM
Unknown Object (File)
Sep 27 2023, 10:13 PM
Unknown Object (File)
Sep 6 2023, 2:09 AM
Unknown Object (File)
Aug 19 2023, 7:31 PM
Subscribers

Details

Summary

Set debug.fail_point.random_fortuna_pre_read=return(1) and
debug.fail_point.random_fortuna_seeded=return(1) to return to unseeded
status (sort of).

The goal is to be able to reproduce initial seeding transition problems, e.g.,
Lev's recent CURRENT report about failing newfs arc4random(3) usage.

Test Plan
# Block:
$ sudo sysctl debug.fail_point.random_fortuna_pre_read='return(1)'
debug.fail_point.random_fortuna_pre_read: off -> return(1)
$ sudo sysctl debug.fail_point.random_fortuna_seeded='return(1)'
debug.fail_point.random_fortuna_seeded: off -> return(1)

# Start test operation that uses devrandom and blocks on seeded status:
$ [truss] ./blocked_random_poc
...

# Unblock:
$ sudo sysctl debug.fail_point.random_fortuna_pre_read='off'
debug.fail_point.random_fortuna_pre_read: return(1) -> off
$ sudo sysctl debug.fail_point.random_fortuna_seeded=off
debug.fail_point.random_fortuna_seeded: return(1) -> off

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 19588
Build 19170: arc lint + arc unit

Event Timeline

markm requested changes to this revision.Sep 7 2018, 6:06 PM
markm added inline comments.
sys/dev/random/fortuna.c
398

Please put this inside the #ifdef _KERNEL

466

Again, inside #ifdef _KERNEL, please

This revision now requires changes to proceed.Sep 7 2018, 6:06 PM
cem planned changes to this revision.Sep 8 2018, 1:24 AM
cem added inline comments.
sys/dev/random/fortuna.c
398

Will do.

cem marked 3 inline comments as done.

ifdef _KERNEL failpoint sites

This revision is now accepted and ready to land.Sep 14 2018, 7:46 AM
This revision was automatically updated to reflect the committed changes.