mirror of https://github.com/acidanthera/audk.git
UefiCpuPkg/CpuPageTableLib: Return error on invalid parameters
When LinearAddress or Length is not aligned on 4KB, PageTableMap() should return Invalid Parameter. Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
This commit is contained in:
parent
75e3c2435c
commit
f336e30ba1
|
@ -467,6 +467,13 @@ PageTableMap (
|
|||
return RETURN_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if ((LinearAddress % SIZE_4KB != 0) || (Length % SIZE_4KB != 0)) {
|
||||
//
|
||||
// LinearAddress and Length should be multiple of 4K.
|
||||
//
|
||||
return RETURN_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if ((*BufferSize != 0) && (Buffer == NULL)) {
|
||||
return RETURN_INVALID_PARAMETER;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue