Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: fd9501f582c8ffa10e9ed70f4aca2f66fe0a3931
      
https://github.com/tianocore/edk2/commit/fd9501f582c8ffa10e9ed70f4aca2f66fe0a3931
  Author: Doug Cook (WINDOWS) <[email protected]>
  Date:   2024-12-06 (Fri, 06 Dec 2024)

  Changed paths:
    M MdePkg/Library/DxeRngLib/DxeRngLib.c

  Log Message:
  -----------
  DxeRngLib: GetRandomNumber spurious success

The GetRandomNumber functions in DxeRngLib can return success without
actually generating a random number. This occurs because there are code
paths through `GenerateRandomNumberViaNist800Algorithm` that do not
initialize the `Status` variable.

- Assume mFirstAlgo == MAX_UINTN (no secure algorithms available)
- Assume none of the secure algorithms have `Available` set.
- Assume PcdEnforceSecureRngAlgorithms is TRUE.

In this condition, the `Status` variable is never initialized, `Buffer`
data is never touched. It is fairly likely that Status is 0, so we can
return EFI_SUCCESS without writing anything to Buffer.

Fix is to set `Status = error_code` in this code path.
`EFI_SECURITY_VIOLATION` seems appropriate.

Signed-off-by: Doug Cook <[email protected]>



To unsubscribe from these emails, change your notification settings at 
https://github.com/tianocore/edk2/settings/notifications


_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to