]> git.proxmox.com Git - mirror_edk2.git/commit
MdeModulePkg/UsbBusPei: Reject descriptor whose length is bad
authorRuiyu Ni <ruiyu.ni@intel.com>
Thu, 25 Oct 2018 10:09:46 +0000 (18:09 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Mon, 29 Oct 2018 03:11:03 +0000 (11:11 +0800)
commit70425456dae16fca23540936c8fb0d2b86776b97
treea5a9f70df8c4df585e772afc97d2f089d2c19295
parentc96de1dbaedce11489974c3e977f1de4ec5cfb84
MdeModulePkg/UsbBusPei: Reject descriptor whose length is bad

Today's implementation doesn't check whether the length of
descriptor is valid before using it.

The patch fixes this issue by syncing the similar fix to UsbBusDxe.
70c3c2370a2aefe71cf0f6c1a1e063f7d74e1d79
*MdeModulePkg/UsbBus: Reject descriptor whose length is bad

Additionally the patch also rejects the data when length is
larger than sizeof (PeiUsbDevice->ConfigurationData).

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c