From: "Ard Biesheuvel" <ardb@kernel.org>
To: devel@edk2.groups.io, dougflick@microsoft.com
Cc: Saloni Kasbekar <saloni.kasbekar@intel.com>,
Zachary Clark-williams <zachary.clark-williams@intel.com>
Subject: Re: [edk2-devel] [PATCH v1 07/14] NetworkPkg:: SECURITY PATCH CVE-2023-45237
Date: Wed, 8 May 2024 18:20:21 +0200 [thread overview]
Message-ID: <CAMj1kXHGepQUpY2a-QzkA9=fJkG_Ho9bwVyhuafRnE5L9WF2sg@mail.gmail.com> (raw)
In-Reply-To: <20240508152925.741226-8-doug.edk2@gmail.com>
On Wed, 8 May 2024 at 17:29, Doug Flick via groups.io
<dougflick=microsoft.com@groups.io> wrote:
>
> From: Doug Flick <dougflick@microsoft.com>
>
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4542
>
> Bug Overview:
> PixieFail Bug #9
> CVE-2023-45237
> CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
> CWE-338 Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)
>
> Use of a Weak PseudoRandom Number Generator
>
> Change Overview:
>
> Updates all Instances of NET_RANDOM (NetRandomInitSeed ()) to either
>
> >
> > EFI_STATUS
> > EFIAPI
> > PseudoRandomU32 (
> > OUT UINT32 *Output
> > );
> >
>
> or (depending on the use case)
>
> >
> > EFI_STATUS
> > EFIAPI
> > PseudoRandom (
> > OUT VOID *Output,
> > IN UINTN OutputLength
> > );
> >
>
> This is because the use of
>
> Example:
>
> The following code snippet PseudoRandomU32 () function is used:
>
> >
> > UINT32 Random;
> >
> > Status = PseudoRandomU32 (&Random);
> > if (EFI_ERROR (Status)) {
> > DEBUG ((DEBUG_ERROR, "%a failed to generate random number: %r\n",
> __func__, Status));
> > return Status;
> > }
> >
>
> This also introduces a new PCD to enable/disable the use of the
> NIST SP-800-90 approved algorithms for PseudoRandom () and
> instead depend on the default implementation. This may be required for
> some platforms where the UEFI Spec defined algorithms are not available.
>
> >
> > PcdEnforceSecureRngAlgorithms
> >
>
> If the platform does not have the NIST SP-800-90 approved algorithms
> then the driver will assert.
>
> Cc: Saloni Kasbekar <saloni.kasbekar@intel.com>
> Cc: Zachary Clark-williams <zachary.clark-williams@intel.com>
>
> Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com>
> ---
> NetworkPkg/NetworkPkg.dec | 7 ++
> NetworkPkg/Library/DxeNetLib/DxeNetLib.inf | 12 +-
> NetworkPkg/TcpDxe/TcpDxe.inf | 3 +
> NetworkPkg/IScsiDxe/IScsiMisc.h | 6 +-
> NetworkPkg/Include/Library/NetLib.h | 40 ++++--
> NetworkPkg/Ip6Dxe/Ip6Nd.h | 8 +-
> NetworkPkg/Dhcp4Dxe/Dhcp4Driver.c | 10 +-
> NetworkPkg/Dhcp6Dxe/Dhcp6Driver.c | 11 +-
> NetworkPkg/DnsDxe/DnsDhcp.c | 10 +-
> NetworkPkg/DnsDxe/DnsImpl.c | 11 +-
> NetworkPkg/HttpBootDxe/HttpBootDhcp6.c | 10 +-
> NetworkPkg/IScsiDxe/IScsiCHAP.c | 19 ++-
> NetworkPkg/IScsiDxe/IScsiMisc.c | 14 +--
> NetworkPkg/Ip4Dxe/Ip4Driver.c | 10 +-
> NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c | 9 +-
> NetworkPkg/Ip6Dxe/Ip6Driver.c | 17 ++-
> NetworkPkg/Ip6Dxe/Ip6If.c | 12 +-
> NetworkPkg/Ip6Dxe/Ip6Mld.c | 12 +-
> NetworkPkg/Ip6Dxe/Ip6Nd.c | 33 ++++-
> NetworkPkg/Library/DxeNetLib/DxeNetLib.c | 129 +++++++++++++++++---
> NetworkPkg/TcpDxe/TcpDriver.c | 15 ++-
> NetworkPkg/Udp4Dxe/Udp4Driver.c | 10 +-
> NetworkPkg/Udp6Dxe/Udp6Driver.c | 11 +-
> NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c | 9 +-
> NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c | 11 +-
> NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c | 12 +-
> NetworkPkg/SecurityFixes.yaml | 39 ++++++
> 27 files changed, 407 insertions(+), 83 deletions(-)
>
> diff --git a/NetworkPkg/NetworkPkg.dec b/NetworkPkg/NetworkPkg.dec
> index e06f35e7747c..7c4289b77b21 100644
> --- a/NetworkPkg/NetworkPkg.dec
> +++ b/NetworkPkg/NetworkPkg.dec
> @@ -5,6 +5,7 @@
> #
> # Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.<BR>
> # (C) Copyright 2015-2020 Hewlett Packard Enterprise Development LP<BR>
> +# Copyright (c) Microsoft Corporation
> #
> # SPDX-License-Identifier: BSD-2-Clause-Patent
> #
> @@ -130,6 +131,12 @@ [PcdsFixedAtBuild, PcdsPatchableInModule]
> # @Prompt Indicates whether SnpDxe creates event for ExitBootServices() call.
> gEfiNetworkPkgTokenSpaceGuid.PcdSnpCreateExitBootServicesEvent|TRUE|BOOLEAN|0x1000000C
>
> + ## Enforces the use of Secure UEFI spec defined RNG algorithms for all network connections.
> + # TRUE - Enforce the use of Secure UEFI spec defined RNG algorithms.
> + # FALSE - Do not enforce and depend on the default implementation of RNG algorithm from the provider.
> + # @Prompt Enforce the use of Secure UEFI spec defined RNG algorithms.
> + gEfiNetworkPkgTokenSpaceGuid.PcdEnforceSecureRngAlgorithms|TRUE|BOOLEAN|0x1000000D
> +
This conflates 'secure' with 'specified by NIST', which I don't think
is entirely accurate.
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118691): https://edk2.groups.io/g/devel/message/118691
Mute This Topic: https://groups.io/mt/105983246/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2024-05-08 16:20 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-08 15:29 [edk2-devel] [PATCH v1 00/14] NetworkPkg: CVE-2023-45236 and CVE-2023-45237 Doug Flick via groups.io
2024-05-08 15:29 ` [edk2-devel] [PATCH v1 01/14] EmulatorPkg: : Add RngDxe to EmulatorPkg Doug Flick via groups.io
2024-05-08 15:29 ` [edk2-devel] [PATCH v1 02/14] EmulatorPkg: : Add Hash2DxeCrypto " Doug Flick via groups.io
2024-05-10 3:10 ` Ni, Ray
2024-05-08 15:29 ` [edk2-devel] [PATCH v1 03/14] OvmfPkg:PlatformCI: Support virtio-rng-pci Doug Flick via groups.io
2024-05-08 15:29 ` [edk2-devel] [PATCH v1 04/14] OvmfPkg: : Add Hash2DxeCrypto to OvmfPkg Doug Flick via groups.io
2024-05-08 15:29 ` [edk2-devel] [PATCH v1 05/14] ArmVirtPkg:PlatformCI: Support virtio-rng-pci Doug Flick via groups.io
2024-05-08 15:29 ` [edk2-devel] [PATCH v1 06/14] ArmVirtPkg: : Add Hash2DxeCrypto to ArmVirtPkg Doug Flick via groups.io
2024-05-08 15:29 ` [edk2-devel] [PATCH v1 07/14] NetworkPkg:: SECURITY PATCH CVE-2023-45237 Doug Flick via groups.io
2024-05-08 16:20 ` Ard Biesheuvel [this message]
2024-05-08 16:47 ` Doug Flick via groups.io
2024-05-08 16:58 ` Ard Biesheuvel
2024-05-08 18:05 ` Doug Flick via groups.io
2024-05-08 20:40 ` Doug Flick via groups.io
2024-05-08 21:19 ` Ard Biesheuvel
2024-05-08 22:52 ` Michael Brown
2024-05-08 15:29 ` [edk2-devel] [PATCH v1 08/14] NetworkPkg: TcpDxe: SECURITY PATCH CVE-2023-45236 Doug Flick via groups.io
2024-05-08 15:29 ` [edk2-devel] [PATCH v1 09/14] OvmfPkg: Disable NIST Algorithms NetworkPkg Doug Flick via groups.io
2024-05-08 15:29 ` [edk2-devel] [PATCH v1 10/14] ArmVirtPkg: : Disables NIST algorithms NetworkPkg Doug Flick via groups.io
2024-05-08 15:29 ` [edk2-devel] [PATCH v1 11/14] MdePkg: : Add MockUefiBootServicesTableLib Doug Flick via groups.io
2024-05-08 15:29 ` [edk2-devel] [PATCH v1 12/14] MdePkg: : Adds Protocol for MockRng Doug Flick via groups.io
2024-05-08 15:29 ` [edk2-devel] [PATCH v1 13/14] MdePkg: Add MockHash2 Protocol for testing Doug Flick via groups.io
2024-05-08 15:29 ` [edk2-devel] [PATCH v1 14/14] NetworkPkg: Update the PxeBcDhcp6GoogleTest due to underlying changes Doug Flick via groups.io
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMj1kXHGepQUpY2a-QzkA9=fJkG_Ho9bwVyhuafRnE5L9WF2sg@mail.gmail.com' \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox