回复: [edk2-devel] 回复: [PATCH] MdeModulePkg/PlatformDriOverrideDxe: Fix overflow condition check

gaoliming gaoliming at byosoft.com.cn
Fri May 21 05:40:07 UTC 2021


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





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#75440): https://edk2.groups.io/g/devel/message/75440
Mute This Topic: https://groups.io/mt/82979905/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list