diff options
author | James Bottomley <jejb@linux.ibm.com> | 2020-11-26 04:13:48 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-11-27 01:19:34 +0000 |
commit | 872f953262d68a11da7bc2fb3ded16df234b8700 (patch) | |
tree | e7fb3c875b822cb51927d82c293f4144b4fcbc98 /StdLib/Include/Ipf/machine/vmparam.h | |
parent | 21f984cedec1c613218480bc3eb5e92349a7a812 (diff) | |
download | edk2-stable202011.tar.gz edk2-stable202011.tar.bz2 edk2-stable202011.zip |
MdeModulePkg/VariablePolicyLib: Fix runtime panic in ValidateSetVariable()edk2-stable202011
The current variable policy is allocated by AllocatePool(), which is
boot time only. This means that if you do any variable setting in the
runtime, the policy has been freed. Ordinarily this isn't detected
because freed memory is still there, but when you boot the Linux
kernel, it's been remapped so the actual memory no longer exists in
the memory map causing a page fault.
Fix this by making it AllocateRuntimePool(). For SMM drivers, the
platform DSC is responsible for resolving the MemoryAllocationLib
class to the SmmMemoryAllocationLib instance. In the
SmmMemoryAllocationLib instance, AllocatePool() and
AllocateRuntimePool() are implemented identically. Therefore this
change is a no-op when the RegisterVariablePolicy() function is built
into an SMM driver. The fix affects runtime DXE drivers only.
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3092
Signed-off-by: James Bottomley <jejb@linux.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'StdLib/Include/Ipf/machine/vmparam.h')
0 files changed, 0 insertions, 0 deletions