Skip to content

CoCo/RDRAND brokenness fixes

Jason A. Donenfeld linux-coco lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 6 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2x86/archrandom: WARN if RDRAND fails and don't retryarch/x86/include/asm/archrandom.h+7 -110 replies
2/2x86/coco: Require seeding RNG with RDRAND on CoCo systemsarch/x86/coco/core.c arch/x86/include/asm/coco.h arch/x86/kernel/setup.c+40 -06 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] CoCo/RDRAND brokenness fixes

This takes a two-pronged approach to the matter, now that we have details from Intel and AMD:

- In the generic case, if RDRAND fails, simply WARN(), and don't try again. It turns out the "try 10 times" thing isn't actually a correct recommendation from Intel. Since RDRAND failure implies CPU failure, a WARN() seems in order on all platforms.

- On CoCo machines, where RDRAND failure implies the whole threat model is compromised and execution shouldn't continue, we ensure that the RNG gets 256-bits of RDRAND at boot, or otherwise fails.

Cc Borislav Petkov <[email protected]>
Cc Daniel P. Berrangé <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Elena Reshetova <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Kirill A. Shutemov <[email protected]>
Cc Theodore Ts'o <[email protected]>
Cc Thomas Gleixner <[email protected]>

Jason A. Donenfeld (2):
x86/archrandom: WARN if RDRAND fails and don't retry x86/coco: Require seeding RNG with RDRAND on CoCo systems

 arch/x86/coco/core.c              | 37 +++++++++++++++++++++++++++++++
 arch/x86/include/asm/archrandom.h | 18 ++++++---------
 arch/x86/include/asm/coco.h       |  2 ++
 arch/x86/kernel/setup.c           |  2 ++
 4 files changed, 48 insertions(+), 11 deletions(-)
Signature · 1 line
2.43.0