public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "gaoliming" <gaoliming@byosoft.com.cn>
To: "'Walon Li'" <walon.li@hpe.com>, <devel@edk2.groups.io>
Cc: <nickle.wang@hpe.com>, <dandan.bi@intel.com>
Subject: 回复: [PATCH] MdeModulePkg/PlatformDriOverrideDxe: Fix overflow condition check
Date: Thu, 13 May 2021 11:13:57 +0800	[thread overview]
Message-ID: <01c701d747a6$0324de10$096e9a30$@byosoft.com.cn> (raw)
In-Reply-To: <20210513024841.2214-1-walon.li@hpe.com>

Agree this fix. Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

> -----邮件原件-----
> 发件人: Walon Li <walon.li@hpe.com>
> 发送时间: 2021年5月13日 10:49
> 收件人: devel@edk2.groups.io
> 抄送: walon.li@hpe.com; nickle.wang@hpe.com; dandan.bi@intel.com;
> gaoliming@byosoft.com.cn
> 主题: [PATCH] MdeModulePkg/PlatformDriOverrideDxe: Fix overflow
> condition check
> 
> Code mistake, VariableIndex is smaller normally than buffer+buffersize
> so should not break loop.
> 
> Signed-off-by:Walon Li <walon.li@hpe.com>
> ---
>  .../Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c       | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c
> b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c
> index f91f038b7a..bd2d04452f 100644
> --- a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c
> +++
> b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c
> @@ -776,7 +776,7 @@ InitOverridesMapping (
>          // Check buffer overflow
> 
>          //
> 
>          if ((DriverImageInfo->DriverImagePath == NULL) || (VariableIndex
> < (UINT8 *) DriverDevicePath) ||
> 
> -            (VariableIndex < (UINT8 *) VariableBuffer + BufferSize)) {
> 
> +            (VariableIndex > (UINT8 *) VariableBuffer + BufferSize)) {
> 
>            Corrupted = TRUE;
> 
>            break;
> 
>          }
> 
> --
> 2.23.0.windows.1




  reply	other threads:[~2021-05-13  3:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-13  2:48 [PATCH] MdeModulePkg/PlatformDriOverrideDxe: Fix overflow condition check Li, Walon
2021-05-13  3:13 ` gaoliming [this message]
     [not found] ` <167E81CF2BD0E45A.10691@groups.io>
2021-05-21  5:40   ` 回复: [edk2-devel] 回复: " gaoliming

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='01c701d747a6$0324de10$096e9a30$@byosoft.com.cn' \
    --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