]> git.proxmox.com Git - mirror_edk2.git/commit - MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskBlockIo.c
MdeModulePkg/RamDiskDxe: Restrict on RAM disk size (CVE-2018-12180)
authorHao Wu <hao.a.wu@intel.com>
Wed, 7 Feb 2018 04:49:50 +0000 (12:49 +0800)
committerHao Wu <hao.a.wu@intel.com>
Thu, 28 Feb 2019 00:15:51 +0000 (08:15 +0800)
commit38c9fbdcaa0219eb86fe82d90e3f8cfb5a54be9f
treeeed188b5b9379057e0480c0ec57f7dc175bc9f6a
parentfccdb88022c1f6d85c773fce506b10c879063f1d
MdeModulePkg/RamDiskDxe: Restrict on RAM disk size (CVE-2018-12180)

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1134

Originally, the block size of created Ram disks is hard-coded to 512
bytes. However, if the total size of the Ram disk is not a multiple of 512
bytes, there will be potential memory access issues when dealing with the
last block of the Ram disk.

This commit will adjust the block size of the Ram disks to ensure that the
total size is a multiple of the block size.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskBlockIo.c
MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h
MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c