diff options
author | eric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-03-16 09:57:10 +0000 |
---|---|---|
committer | eric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-03-16 09:57:10 +0000 |
commit | 79749182129c18166cad883876b98b3b1e7ff668 (patch) | |
tree | 523619e3dde3aabb7a16c4f96cf9b6bf58963bf5 /MdeModulePkg/Universal | |
parent | e343d4473d173147b383a00ae7cdf8555b048ee6 (diff) | |
download | edk2-79749182129c18166cad883876b98b3b1e7ff668.zip edk2-79749182129c18166cad883876b98b3b1e7ff668.tar.gz edk2-79749182129c18166cad883876b98b3b1e7ff668.tar.bz2 |
Fix tracker 202216:linux runtime test issue.
[Root Cause]
The root cause is that in FindVariable function, original code logic will traverse all variable stored in variable volatile/non-volatile area. If the non-variable area is full and Linux sets a new variable, the caller of GetNextVariablePtr will get the address of next memory block, but this block doesn't be reserved as RUNTIME attribute. Therefore its corresponding page translation table doesn't exist and causes linux kernel panic.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7890 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r-- | MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c index 98da3b8..7a69a22 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -930,7 +930,7 @@ FindVariable ( InDeletedVariable = NULL;
InDeletedStorageIndex = 0;
for (Index = 0; Index < 2; Index++) {
- while (IsValidVariableHeader (Variable[Index]) && (Variable[Index] <= GetEndPointer (VariableStoreHeader[Index]))) {
+ while ((Variable[Index] < GetEndPointer (VariableStoreHeader[Index])) && IsValidVariableHeader (Variable[Index])) {
if (Variable[Index]->State == VAR_ADDED ||
Variable[Index]->State == (VAR_IN_DELETED_TRANSITION & VAR_ADDED)
) {
@@ -2090,10 +2090,10 @@ FvbNotificationEvent ( Status = VariableCommonInitialize (Fvb);
ASSERT_EFI_ERROR (Status);
- SystemTable->RuntimeServices->GetVariable = RuntimeServiceGetVariable;
+ SystemTable->RuntimeServices->GetVariable = RuntimeServiceGetVariable;
SystemTable->RuntimeServices->GetNextVariableName = RuntimeServiceGetNextVariableName;
- SystemTable->RuntimeServices->SetVariable = RuntimeServiceSetVariable;
- SystemTable->RuntimeServices->QueryVariableInfo = RuntimeServiceQueryVariableInfo;
+ SystemTable->RuntimeServices->SetVariable = RuntimeServiceSetVariable;
+ SystemTable->RuntimeServices->QueryVariableInfo = RuntimeServiceQueryVariableInfo;
//
// Now install the Variable Runtime Architectural Protocol on a new handle
|