public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Siyuan, Fu" <siyuan.fu@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Zhang, Shenglei" <shenglei.zhang@intel.com>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>,
	"Wu, Jiaxin" <jiaxin.wu@intel.com>
Subject: Re: [edk2-devel] [PATCH] NetworkPkg/IScsiDxe: Enhance the check for array boundary
Date: Sun, 26 Apr 2020 01:00:36 +0000	[thread overview]
Message-ID: <B1FF2E9001CE9041BD10B825821D5BC58BA0BDD2@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <20200424091356.157536-1-shenglei.zhang@intel.com>

Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Zhang,
> Shenglei
> Sent: 2020年4月24日 17:14
> To: devel@edk2.groups.io
> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>; Wu, Jiaxin
> <jiaxin.wu@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>
> Subject: [edk2-devel] [PATCH] NetworkPkg/IScsiDxe: Enhance the check for
> array boundary
> 
> Array 'TargetUrl' of size 255 may use index value(s) 255 and 256.
> So enhance the boundary check to ensure the index is valid.
> 
> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
> Cc: Siyuan Fu <siyuan.fu@intel.com>
> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
> ---
>  NetworkPkg/IScsiDxe/IScsiDhcp.c  | 2 +-
>  NetworkPkg/IScsiDxe/IScsiDhcp6.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp.c
> b/NetworkPkg/IScsiDxe/IScsiDhcp.c
> index 7ce9bf575012..afa8a86cd419 100644
> --- a/NetworkPkg/IScsiDxe/IScsiDhcp.c
> +++ b/NetworkPkg/IScsiDxe/IScsiDhcp.c
> @@ -122,7 +122,7 @@ IScsiDhcpExtractRootPath (
>    //
>    if ((!NET_IS_DIGIT (*(Field->Str))) && (*(Field->Str) != '[')) {
>      ConfigNvData->DnsMode = TRUE;
> -    if (Field->Len > sizeof (ConfigNvData->TargetUrl)) {
> +    if ((Field->Len + 2) > sizeof (ConfigNvData->TargetUrl)) {
>        return EFI_INVALID_PARAMETER;
>      }
>      CopyMem (&ConfigNvData->TargetUrl, Field->Str, Field->Len);
> diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp6.c
> b/NetworkPkg/IScsiDxe/IScsiDhcp6.c
> index 86a872adeccc..691650b7334f 100644
> --- a/NetworkPkg/IScsiDxe/IScsiDhcp6.c
> +++ b/NetworkPkg/IScsiDxe/IScsiDhcp6.c
> @@ -161,7 +161,7 @@ IScsiDhcp6ExtractRootPath (
>    // Server name is expressed as domain name, just save it.
>    //
>    if (ConfigNvData->DnsMode) {
> -    if (Field->Len > sizeof (ConfigNvData->TargetUrl)) {
> +    if ((Field->Len + 2) > sizeof (ConfigNvData->TargetUrl)) {
>        return EFI_INVALID_PARAMETER;
>      }
>      CopyMem (&ConfigNvData->TargetUrl, Field->Str, Field->Len);
> --
> 2.18.0.windows.1
> 
> 
> 


      reply	other threads:[~2020-04-26  1:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24  9:13 [PATCH] NetworkPkg/IScsiDxe: Enhance the check for array boundary Zhang, Shenglei
2020-04-26  1:00 ` Siyuan, Fu [this message]

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=B1FF2E9001CE9041BD10B825821D5BC58BA0BDD2@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