MdeModulePkg Variable: Add missing warning annotation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16401 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Star Zeng
2014-11-19 01:08:23 +00:00
committed by lzeng14
parent 285a175441
commit 18a7dbbc02
6 changed files with 61 additions and 1 deletions

View File

@@ -3,6 +3,17 @@
The common variable operation routines shared by DXE_RUNTIME variable
module and DXE_SMM variable module.
Caution: This module requires additional review when modified.
This driver will have external input - variable data. They may be input in SMM mode.
This external input must be validated carefully to avoid security issue like
buffer overflow, integer overflow.
VariableServiceGetNextVariableName () and VariableServiceQueryVariableInfo() are external API.
They need check input parameter.
VariableServiceGetVariable() and VariableServiceSetVariable() are external API
to receive datasize and data buffer. The size should be checked carefully.
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -2276,6 +2287,10 @@ VariableLockRequestToLock (
This code finds variable in storage blocks (Volatile or Non-Volatile).
Caution: This function may receive untrusted input.
This function may be invoked in SMM mode, and datasize is external input.
This function will do basic validation, before parse the data.
@param VariableName Name of Variable to be found.
@param VendorGuid Variable vendor GUID.
@param Attributes Attribute value of the variable found.
@@ -2353,6 +2368,9 @@ Done:
This code Finds the Next available variable.
Caution: This function may receive untrusted input.
This function may be invoked in SMM mode. This function will do basic validation, before parse the data.
@param VariableNameSize Size of the variable name.
@param VariableName Pointer to variable name.
@param VendorGuid Variable Vendor Guid.
@@ -2515,6 +2533,10 @@ Done:
This code sets variable in storage blocks (Volatile or Non-Volatile).
Caution: This function may receive untrusted input.
This function may be invoked in SMM mode, and datasize and data are external input.
This function will do basic validation, before parse the data.
@param VariableName Name of Variable to be found.
@param VendorGuid Variable vendor GUID.
@param Attributes Attribute value of the variable found
@@ -2686,6 +2708,9 @@ Done:
This code returns information about the EFI variables.
Caution: This function may receive untrusted input.
This function may be invoked in SMM mode. This function will do basic validation, before parse the data.
@param Attributes Attributes bitmask to specify the type of variables
on which to return information.
@param MaximumVariableStorageSize Pointer to the maximum size of the storage space available
@@ -2839,6 +2864,9 @@ VariableServiceQueryVariableInfoInternal (
This code returns information about the EFI variables.
Caution: This function may receive untrusted input.
This function may be invoked in SMM mode. This function will do basic validation, before parse the data.
@param Attributes Attributes bitmask to specify the type of variables
on which to return information.
@param MaximumVariableStorageSize Pointer to the maximum size of the storage space available
@@ -2910,7 +2938,10 @@ VariableServiceQueryVariableInfo (
/**
This function reclaims variable storage if free size is below the threshold.
Caution: This function may be invoked at SMM mode.
Care must be taken to make sure not security issue.
**/
VOID
ReclaimForOS(