Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RdRandGenerateEntropy problems (Bugzilla Bug 4714) #711

Open
tianocore-issues opened this issue Feb 26, 2024 · 2 comments
Open

RdRandGenerateEntropy problems (Bugzilla Bug 4714) #711

tianocore-issues opened this issue Feb 26, 2024 · 2 comments

Comments

@tianocore-issues
Copy link

This issue was created automatically with bugzilla2github

Bugzilla Bug 4714

Date: 2024-02-26T13:00:06+00:00
From: @jkmathews
To: @nate-desimone
CC: @lgao4

Last updated: 2024-03-05T21:47:50+00:00

@tianocore-issues
Copy link
Author

Comment 22656

Date: 2024-02-26 13:00:06 +0000
From: @jkmathews

  • Industry Specification: ---
  • Release Observed: edk2-stable202302
  • Releases to Fix: EDK II Master
  • Target OS: ---
  • Bugzilla Assignee(s): @nate-desimone

The RdRandGenerateEntropy() function is not up to date with versions of this same function in EDK2 code:
SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c

This copy of RdRandGenerateEntropy() function has multiple problems. It should be removed if not needed, or replaced with the updated EDK2 code.

There are at least 4 problems in this copy of RdRandGenerateEntropy() function:
(1) BlockCount = Lenth / 64 -> should be 16 (128 bit / 8) or sizeof(Seed)
(2) Status from GetRandomNumber128 is a BOOLEAN not Return Status. If the call is successful it will result in an error as it returns TRUE (EFI_SUCCESS is 0).
(3) Copymem copies part of the stack -> sizeof Seed is 16 not 64 (same for both instances unless Length is less than 16)
(4) Copymem will produce repeatable stack pattern with longer requested random data (reduced entropy)

@tianocore-issues
Copy link
Author

Comment 22698

Date: 2024-03-05 21:47:50 +0000
From: @lgao4

nathaniel.l.desimone@intel.com: please check this issue first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant