summaryrefslogtreecommitdiffstats
path: root/Nt32Pkg/FvbServicesRuntimeDxe
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2007-11-05 06:29:00 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2007-11-05 06:29:00 +0000
commita4c9ede55fdd3de2c9138f45c4e1ca42947ed549 (patch)
tree7d62bdc0cf8aa04e79ca5a6cebaf82ddef9894be /Nt32Pkg/FvbServicesRuntimeDxe
parenta3589760c461266cca9a88a27fa9b54454dc9b82 (diff)
downloadedk2-a4c9ede55fdd3de2c9138f45c4e1ca42947ed549.tar.gz
edk2-a4c9ede55fdd3de2c9138f45c4e1ca42947ed549.tar.bz2
edk2-a4c9ede55fdd3de2c9138f45c4e1ca42947ed549.zip
the implementation of FVB->SetAttribute() interface should check the unchanged bit in parameter at first.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4267 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Nt32Pkg/FvbServicesRuntimeDxe')
-rw-r--r--Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c b/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c
index 7b00fd9b3a..a95d3b400d 100644
--- a/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c
+++ b/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c
@@ -740,6 +740,7 @@ Returns:
UINT32 OldStatus;
UINT32 NewStatus;
EFI_STATUS Status;
+ EFI_FVB_ATTRIBUTES UnchangedAttributes;
//
// Find the right instance of the FVB private data
@@ -758,6 +759,24 @@ Returns:
OldStatus = OldAttributes & EFI_FVB2_STATUS;
NewStatus = *Attributes & EFI_FVB2_STATUS;
+ UnchangedAttributes = EFI_FVB2_READ_DISABLED_CAP | \
+ EFI_FVB2_READ_ENABLED_CAP | \
+ EFI_FVB2_WRITE_DISABLED_CAP | \
+ EFI_FVB2_WRITE_ENABLED_CAP | \
+ EFI_FVB2_LOCK_CAP | \
+ EFI_FVB2_STICKY_WRITE | \
+ EFI_FVB2_MEMORY_MAPPED | \
+ EFI_FVB2_ERASE_POLARITY | \
+ EFI_FVB2_READ_LOCK_CAP | \
+ EFI_FVB2_WRITE_LOCK_CAP | \
+ EFI_FVB2_ALIGNMENT;
+
+ //
+ // Some attributes of FV is read only can *not* be set
+ //
+ if ((OldAttributes & UnchangedAttributes) ^ (*Attributes & UnchangedAttributes)) {
+ return EFI_INVALID_PARAMETER;
+ }
//
// If firmware volume is locked, no status bit can be updated
//