audk/UefiCpuPkg/PiSmmCpuDxeSmm
Kun Qin a7d8e28b29 UefiCpuPkg: PiSmmCpuDxeSmm: Check buffer size before accessing
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3283

Current SMM Save State routine does not check the number of bytes to be
read, when it comse to read IO_INFO, before casting the incoming buffer
to EFI_SMM_SAVE_STATE_IO_INFO. This could potentially cause memory
corruption due to extra bytes are written out of buffer boundary.

This change adds a width check before copying IoInfo into output buffer.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>

Signed-off-by: Kun Qin <kuqin12@gmail.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20210406195254.1018-2-kuqin12@gmail.com>
2021-04-12 17:23:54 +00:00
..
Ia32 UefiCpuPkg/PiSmmCpuDxeSmm: Reflect page table depth with page table address 2020-11-18 04:52:26 +00:00
X64 UefiCpuPkg/PiSmmCpuDxeSmm: Support detect SMM shadow stack overflow 2021-04-09 05:33:35 +00:00
CpuS3.c UefiCpuPkg PiSmmCpuDxeSmm: Reduce SMRAM consumption in CpuS3.c 2021-01-11 09:13:48 +00:00
CpuService.c UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
CpuService.h UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
MpService.c UefiCpuPkg/PiSmmCpu: Don't allocate Token for SmmStartupThisAp 2021-03-11 01:44:51 +00:00
PiSmmCpuDxeSmm.c UefiCpuPkg/PiSmm: Fix various typos 2020-02-10 22:30:07 +00:00
PiSmmCpuDxeSmm.h UefiCpuPkg: PiSmmCpuDxeSmm: Check buffer size before accessing 2021-04-12 17:23:54 +00:00
PiSmmCpuDxeSmm.inf UefiCpuPkg/PiSmmCpuDxeSmm: Avoid allocate Token every time 2019-12-06 06:41:16 +00:00
PiSmmCpuDxeSmm.uni UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
PiSmmCpuDxeSmmExtra.uni UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
SmmCpuMemoryManagement.c UefiCpuPkg/PiSmmCpuDxeSmm: Reflect page table depth with page table address 2020-11-18 04:52:26 +00:00
SmmMp.c UefiCpuPkg/PiSmmCpuDxeSmm: Enable MM MP Protocol 2019-07-16 11:54:55 +08:00
SmmMp.h UefiCpuPkg/PiSmmCpuDxeSmm: Keep function comment and declaration adjacent 2019-08-02 14:19:13 +08:00
SmmProfile.c UefiCpuPkg: PiSmmCpuDxeSmm skip MSR_IA32_MISC_ENABLE manipulation on AMD 2020-07-07 23:25:16 +00:00
SmmProfile.h UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
SmmProfileInternal.h UefiCpuPkg: PiSmmCpuDxeSmm skip MSR_IA32_MISC_ENABLE manipulation on AMD 2020-07-07 23:25:16 +00:00
SmramSaveState.c UefiCpuPkg: PiSmmCpuDxeSmm: Check buffer size before accessing 2021-04-12 17:23:54 +00:00
SyncTimer.c UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00