From 46c15d9fc16dd33654230a641b6bb4546d849a2d Mon Sep 17 00:00:00 2001 From: Andy Lau Date: Wed, 6 Nov 2024 19:40:45 +0800 Subject: [PATCH] Warn if out of flash space when writing variables --- ...f-flash-space-when-writing-variables.patch | 25 +++++++++++++++++++ edk2.spec | 6 ++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100755 0053-Warn-if-out-of-flash-space-when-writing-variables.patch diff --git a/0053-Warn-if-out-of-flash-space-when-writing-variables.patch b/0053-Warn-if-out-of-flash-space-when-writing-variables.patch new file mode 100755 index 0000000..429854f --- /dev/null +++ b/0053-Warn-if-out-of-flash-space-when-writing-variables.patch @@ -0,0 +1,25 @@ +From 281505666903555eb49221e4889d373cb6f7b384 Mon Sep 17 00:00:00 2001 +From: Andy Lau +Date: Wed, 6 Nov 2024 19:22:59 +0800 +Subject: [PATCH] Warn if out of flash space when writing variables + +--- + MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +index 7a13312..c5412f5 100644 +--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c ++++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +@@ -2401,6 +2401,8 @@ Done: + ); + ASSERT_EFI_ERROR (Status); + } ++ } else if (Status == EFI_OUT_OF_RESOURCES) { ++ DEBUG ((DEBUG_WARN, "UpdateVariable failed: Out of flash space\n")); + } + + return Status; +-- +2.34.1 + diff --git a/edk2.spec b/edk2.spec index 8b97367..44af4f7 100644 --- a/edk2.spec +++ b/edk2.spec @@ -7,7 +7,7 @@ Name: edk2 Version: %{stable_date} -Release: 12 +Release: 13 Summary: EFI Development Kit II License: BSD-2-Clause-Patent and OpenSSL and MIT URL: https://github.com/tianocore/edk2 @@ -85,6 +85,7 @@ patch50: 0050-MdePkg-Fix-overflow-issue-in-BasePeCoffLib.patch # Fix CVE-2023-45236、CVE-2023-45237 patch51: 0051-NetworkPkg-SECURITY-PATCH-CVE-2023-45237.patch patch52: 0052-NetworkPkg-TcpDxe-SECURITY-PATCH-CVE-2023-45236.patch +patch53: 0053-Warn-if-out-of-flash-space-when-writing-variables.patch BuildRequires: acpica-tools gcc gcc-c++ libuuid-devel python3 bc nasm python3-unversioned-command isl @@ -324,6 +325,9 @@ chmod +x %{buildroot}%{_bindir}/Rsa2048Sha256GenerateKeys %endif %changelog +* Wed Nov 6 2024 andy - 202308-13 +- warn if out of flash space when writing variables + * Mon Oct 14 2024 shenyage - 202308-12 - fix CVE-2023-45236、CVE-2023-45237 -- Gitee