public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/PlatformDriOverrideDxe: Fix overflow condition check
@ 2021-05-13  2:48 Li, Walon
  2021-05-13  3:13 ` 回复: " gaoliming
       [not found] ` <167E81CF2BD0E45A.10691@groups.io>
  0 siblings, 2 replies; 3+ messages in thread
From: Li, Walon @ 2021-05-13  2:48 UTC (permalink / raw)
  To: devel; +Cc: walon.li, nickle.wang, dandan.bi, gaoliming

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


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

* 回复: [PATCH] MdeModulePkg/PlatformDriOverrideDxe: Fix overflow condition check
  2021-05-13  2:48 [PATCH] MdeModulePkg/PlatformDriOverrideDxe: Fix overflow condition check Li, Walon
@ 2021-05-13  3:13 ` gaoliming
       [not found] ` <167E81CF2BD0E45A.10691@groups.io>
  1 sibling, 0 replies; 3+ messages in thread
From: gaoliming @ 2021-05-13  3:13 UTC (permalink / raw)
  To: 'Walon Li', devel; +Cc: nickle.wang, dandan.bi

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




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

* 回复: [edk2-devel] 回复: [PATCH] MdeModulePkg/PlatformDriOverrideDxe: Fix overflow condition check
       [not found] ` <167E81CF2BD0E45A.10691@groups.io>
@ 2021-05-21  5:40   ` gaoliming
  0 siblings, 0 replies; 3+ messages in thread
From: gaoliming @ 2021-05-21  5:40 UTC (permalink / raw)
  To: devel, gaoliming, 'Walon Li'; +Cc: nickle.wang, dandan.bi

Create PR https://github.com/tianocore/edk2/pull/1658.

This patch passed code review before soft feature freeze. So, I merge it for
this stable tag. 

Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 gaoliming
> 发送时间: 2021年5月13日 11:14
> 收件人: 'Walon Li' <walon.li@hpe.com>; devel@edk2.groups.io
> 抄送: nickle.wang@hpe.com; dandan.bi@intel.com
> 主题: [edk2-devel] 回复: [PATCH] MdeModulePkg/PlatformDriOverrideDxe:
> Fix overflow condition check
> 
> 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
> 
> 
> 
> 
> 
> 
> 




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

end of thread, other threads:[~2021-05-21  5:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-13  2:48 [PATCH] MdeModulePkg/PlatformDriOverrideDxe: Fix overflow condition check Li, Walon
2021-05-13  3:13 ` 回复: " gaoliming
     [not found] ` <167E81CF2BD0E45A.10691@groups.io>
2021-05-21  5:40   ` 回复: [edk2-devel] " gaoliming

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