From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web12.8189.1620875641641301880 for ; Wed, 12 May 2021 20:14:02 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Thu, 13 May 2021 11:13:57 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'Walon Li'" , Cc: , References: <20210513024841.2214-1-walon.li@hpe.com> In-Reply-To: <20210513024841.2214-1-walon.li@hpe.com> Subject: =?UTF-8?B?5Zue5aSNOiBbUEFUQ0hdIE1kZU1vZHVsZVBrZy9QbGF0Zm9ybURyaU92ZXJyaWRlRHhlOiBGaXggb3ZlcmZsb3cgY29uZGl0aW9uIGNoZWNr?= Date: Thu, 13 May 2021 11:13:57 +0800 Message-ID: <01c701d747a6$0324de10$096e9a30$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHwvWYe4XvtPSUJHirY9xkwAFz9wKqt0TBg Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Agree this fix. Reviewed-by: Liming Gao > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: Walon Li > =B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA5=D4=C213=C8=D5 10:49 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: walon.li@hpe.com; nickle.wang@hpe.com; = dandan.bi@intel.com; > gaoliming@byosoft.com.cn > =D6=F7=CC=E2: [PATCH] MdeModulePkg/PlatformDriOverrideDxe: Fix = overflow > condition check >=20 > Code mistake, VariableIndex is smaller normally than buffer+buffersize > so should not break loop. >=20 > Signed-off-by:Walon Li > --- > .../Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c | 2 = +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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 >=20 > // >=20 > if ((DriverImageInfo->DriverImagePath =3D=3D NULL) || = (VariableIndex > < (UINT8 *) DriverDevicePath) || >=20 > - (VariableIndex < (UINT8 *) VariableBuffer + BufferSize)) = { >=20 > + (VariableIndex > (UINT8 *) VariableBuffer + BufferSize)) = { >=20 > Corrupted =3D TRUE; >=20 > break; >=20 > } >=20 > -- > 2.23.0.windows.1