]> git.proxmox.com Git - mirror_edk2.git/commit
MdeModulePkg: Check received packet size before use it.
authorFu Siyuan <siyuan.fu@intel.com>
Mon, 28 Mar 2016 03:00:31 +0000 (11:00 +0800)
committerFu Siyuan <siyuan.fu@intel.com>
Fri, 1 Apr 2016 05:30:08 +0000 (13:30 +0800)
commit1b31acb66c026f2791c959a4ec9b55c04d583c22
tree42fc503e3bf61e9c67de7b063898830d5aa3704e
parentd9ba76b489ea26de8551d32651c726ad992377b5
MdeModulePkg: Check received packet size before use it.

Arbitrary length of packet may be received from network, including the
packets with zero payload data or malformed protocol header. So the code
much check the actually received data size before using it. For example, in
current edk2 network stack, an zero payload UDP packet may cause the
platform ASSERT in NetbufFromExt() because of the zero fragment number.
This patch update the IpIoLib and UdpIoLib to check and discard the zero
payload data packet to avoid above assert. Some other network drivers are
also updated to check the packet size to guarantee the minimum length of
protocol header is received from upper layer driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.c
MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c
MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c