Dear MdePkg Maintainer,
Currently MdePkg/DxeServicesLib does not allow to pass pointer to allocated
buffer to read firmware section to. Is there any reason for that?
This prevents from concatenation of several sections within continuous
memory area without additional copy operation.
Please find the attached patches that fix this issue.
Since InternalGetSectionFromFv() explicitly reinitializes to NULL pointer to
buffer patch 1/2 introduced an additional parameter (BOOLEAN Allocate)
that prevents from that.
A new function GetSectionFromFvToBuffer() was introduced in patch 2/2.
This function acts as GetSectionFromFv() but uses Allocate=FALSE flag passed
to InternalGetSectionFromFv() so it does not reinitializes to NULL pointers
to Buffer and Size explicitly.
An implementation of a new function was required because simple grepping
showed that uninitialized pointers could be passed to GetSectionFromFv()
according to its original description. Here is that calls:
./SecurityPkg/Tcg/TcgSmm/TcgSmm.c:303: Status = GetSectionFromFv (
./OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.c:795: Status =
GetSectionFromFv (
./MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c:877: Status =
GetSectionFromAnyFvByFileType (
./MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c:249: Status
= GetSectionFromAnyFv (
./EdkCompatibilityPkg/Compatibility/BootScriptSaveOnS3SaveStateThunk/ScriptSave.c:844:
Status = GetSectionFromAnyFv
Signed-off-by: Mike Maslenkin <[email protected]>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel