From: "Fu, Siyuan" <siyuan.fu@intel.com>
To: "Wu, Jiaxin" <jiaxin.wu@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Wang, Fan" <fan.wang@intel.com>, "Ye, Ting" <ting.ye@intel.com>
Subject: Re: [Patch 1/3] NetworkPkg/TcpDxe: Check FragmentBuffer for NULL before use
Date: Fri, 22 Dec 2017 07:18:22 +0000 [thread overview]
Message-ID: <B1FF2E9001CE9041BD10B825821D5BC58B3FA484@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1513926438-4160-2-git-send-email-jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
> -----Original Message-----
> From: Wu, Jiaxin
> Sent: Friday, December 22, 2017 3:07 PM
> To: edk2-devel@lists.01.org
> Cc: Fu, Siyuan <siyuan.fu@intel.com>; Wang, Fan <fan.wang@intel.com>; Ye,
> Ting <ting.ye@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
> Subject: [Patch 1/3] NetworkPkg/TcpDxe: Check FragmentBuffer for NULL
> before use
>
> According the Spec, the FragmentBuffers in FragmentTable are allocated
> by the application when calling Receive() function. This patch is to
> check whether the FragmentBuffer is valid or not.
>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Wang Fan <fan.wang@intel.com>
> Cc: Ye Ting <ting.ye@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
> ---
> NetworkPkg/TcpDxe/TcpMain.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/NetworkPkg/TcpDxe/TcpMain.c b/NetworkPkg/TcpDxe/TcpMain.c
> index fc3713e..e349d2d 100644
> --- a/NetworkPkg/TcpDxe/TcpMain.c
> +++ b/NetworkPkg/TcpDxe/TcpMain.c
> @@ -38,10 +38,13 @@ TcpChkDataBuf (
> UINT32 Index;
>
> UINT32 Len;
>
> for (Index = 0, Len = 0; Index < FragmentCount; Index++) {
> + if (FragmentTable[Index].FragmentBuffer == NULL) {
> + return EFI_INVALID_PARAMETER;
> + }
> Len = Len + FragmentTable[Index].FragmentLength;
> }
>
> if (DataLen != Len) {
> return EFI_INVALID_PARAMETER;
> --
> 1.9.5.msysgit.1
next prev parent reply other threads:[~2017-12-22 7:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-22 7:07 [Patch 0/3] NetworkPkg/TcpDxe: Fix some issues in TcpDxe driver Jiaxin Wu
2017-12-22 7:07 ` [Patch 1/3] NetworkPkg/TcpDxe: Check FragmentBuffer for NULL before use Jiaxin Wu
2017-12-22 7:18 ` Fu, Siyuan [this message]
2017-12-22 7:07 ` [Patch 2/3] NetworkPkg/TcpDxe: Remove the redundant code Jiaxin Wu
2017-12-22 7:18 ` Fu, Siyuan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=B1FF2E9001CE9041BD10B825821D5BC58B3FA484@SHSMSX103.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox