public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Array out of bounds write
@ 2017-04-11  8:05 Santhapur Naveen
  2017-04-11 11:53 ` Wu, Jiaxin
  0 siblings, 1 reply; 2+ messages in thread
From: Santhapur Naveen @ 2017-04-11  8:05 UTC (permalink / raw)
  To: edk2-devel@lists.01.org

Hello all,

            In the file PxeBcSupport.c of NetworkPkg there is

EFI_STATUS
PxeBcUdp4Write (
{
            ...
            //
            // Arrange one fragment buffer for data, and another fragment buffer for header if has.
            //
            FragCount = (HeaderSize != NULL) ? 2 : 1;
            ...
            TxData->FragmentTable[FragCount - 1].FragmentLength = (UINT32) *BufferSize;
            ...
}

And similarly in

EFI_STATUS
PxeBcUdp6Write (
{
            ...
            //
            // Arrange one fragment buffer for data, and another fragment buffer for header if has.
            //
            FragCount = (HeaderSize != NULL) ? 2 : 1;
            ...
            TxData->FragmentTable[FragCount - 1].FragmentLength = (UINT32) *BufferSize;
            ...
}

If HeaderSize is not NULL, then there is a chance of writing array over bounds since FragmentTable is of single element.

///
  /// Array of fragment descriptors.
  ///
  EFI_UDP6_FRAGMENT_DATA    FragmentTable[1];

Shouldn't we be taking care of this?


Regards,
Naveen


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-11 11:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-11  8:05 Array out of bounds write Santhapur Naveen
2017-04-11 11:53 ` Wu, Jiaxin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox