From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by mx.groups.io with SMTP id smtpd.web10.5362.1686218828313544288 for ; Thu, 08 Jun 2023 03:07:08 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@ventanamicro.com header.s=google header.b=bWB4xGqe; spf=pass (domain: ventanamicro.com, ip: 209.85.215.171, mailfrom: rsingh@ventanamicro.com) Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-53fb4ee9ba1so141370a12.3 for ; Thu, 08 Jun 2023 03:07:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1686218827; x=1688810827; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=iwkAc11EbeVNh+fLeTo3dx8gyQ/gBkcdCpqtmdBy9e8=; b=bWB4xGqecfk3i8PspGNcFYUGpHS4+bmQwD8T9NSHHuuRVMoy4ehs3i2SsXXInJ9cXs 9KnhAYI9Laty0xmfV7SUepQrqRw+Uhj2vKEtZluLijxb5/0ZTK/qli3Y4vNx+iJZbvFG DQ8q7M78L/XW8iR12KynXvwndhqHa+RkvTlNDTGiK0MF1qoVrCL89iAhbMawK4HY1c0x WUL9wr5zYLx/sSr6wm3CI78xqZ+hvchgowJRdPJvFlRpw7yOR4F7dPTfrxO/FT1G8IUV 9aMFcCq4EwS4fsjfYCiZo0nCgz4U1InErCpvE2bxzNTK6XPxgFm1BYwxGl8YbOAyTh6x xiTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686218827; x=1688810827; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iwkAc11EbeVNh+fLeTo3dx8gyQ/gBkcdCpqtmdBy9e8=; b=jHtMo6y4FtAEmySrNSourEpgtWXEpE32JBaG6j0I0tlnW+mOlJXZ8VCHHh3KXg//VF GY3c1NdyiWyx3zhwm5+Npel2XquZL+kqx2eJg5By0oAVFxiVJ+tyKvjgeHqoHKePmBqi cmSOjrJqf/Ya5kAQc7qznGrWTxRJxqXf+u2GfWytAMmt2lNRFQ2sGYGnGMt3L9xY1DWv 0xzZt/yNnQNbF4AGf2exbK87JSOQCoMFNFzf/31mEd2TZ+p/FW4Z4mudGa5WjeN8kZdG YDsj5XH+9sXztLj0VAIxWeovO2rdJtH1u5xdx/+cvs3roalBPakmq3HXAiASI1corB2S z3fw== X-Gm-Message-State: AC+VfDyXHrDiD3K3jiZ8jIrsJFWZPqjoCJi+9jB0Sgj1Xj1AJcmtmj8X qZmmfDe0OvcGrBbcs9Qbzx4Ixj0kxXu/63tZ0FG/KA== X-Google-Smtp-Source: ACHHUZ4WhG2tgfY01fQP/7a+65tc6+7wOSXU0Jh9GotMkHvL3/aTjNwMLy412flCsiubMrriwIYf3V300fVIcwkBAOk= X-Received: by 2002:a17:90b:38c5:b0:253:828a:28f8 with SMTP id nn5-20020a17090b38c500b00253828a28f8mr3721013pjb.25.1686218827562; Thu, 08 Jun 2023 03:07:07 -0700 (PDT) MIME-Version: 1.0 References: <20230602160852.98282-1-rsingh@ventanamicro.com> In-Reply-To: From: Ranbir Singh Date: Thu, 8 Jun 2023 15:36:56 +0530 Message-ID: Subject: Re: [PATCH 1/1] MdeModulePkg/Bus/Ata/AtaBusDxe: Fix SIGN_EXTENSION Coverity issue To: "Wu, Hao A" Cc: "devel@edk2.groups.io" , "Ni, Ray" Content-Type: multipart/alternative; boundary="0000000000003b131e05fd9b6a2b" --0000000000003b131e05fd9b6a2b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Yes, I have already noted to update this patch on the same lines as discussed in context of https://edk2.groups.io/g/devel/topic/99293622 On Thu, Jun 8, 2023 at 12:48=E2=80=AFPM Wu, Hao A wrot= e: > > -----Original Message----- > > From: Ranbir Singh > > Sent: Saturday, June 3, 2023 12:09 AM > > To: devel@edk2.groups.io; rsingh@ventanamicro.com > > Cc: Wu, Hao A ; Ni, Ray > > Subject: [PATCH 1/1] MdeModulePkg/Bus/Ata/AtaBusDxe: Fix > > SIGN_EXTENSION Coverity issue > > > > From: Ranbir Singh > > > > Line number 365 does contain a typecast with UINT32, but it is after > > all the operations (16-bit left shift followed by OR'ing) are over. > > To avoid any SIGN_EXTENSION, typecast the intermediate result after > > 16-bit left shift operation immediately with UINT32. > > > > Cc: Hao A Wu > > Cc: Ray Ni > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4209 > > Signed-off-by: Ranbir Singh > > --- > > MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c > > b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c > > index a77852bae054..ccd4c5f05b59 100644 > > --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c > > +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c > > @@ -362,7 +362,7 @@ IdentifyAtaDevice ( > > // Check logical block size > > > > // > > > > if ((PhyLogicSectorSupport & BIT12) !=3D 0) { > > > > - BlockMedia->BlockSize =3D > (UINT32)(((IdentifyData->logic_sector_size_hi > > << 16) | IdentifyData->logic_sector_size_lo) * sizeof (UINT16)); > > > > + BlockMedia->BlockSize =3D > (((UINT32)(IdentifyData->logic_sector_size_hi > > << 16) | IdentifyData->logic_sector_size_lo) * sizeof (UINT16)); > > > > } > > > This patch seems to have the same issue with the concern raised in > https://edk2.groups.io/g/devel/topic/99293622. > > Best Regards, > Hao Wu > > > > > > > > > > AtaDevice->BlockIo.Revision =3D EFI_BLOCK_IO_PROTOCOL_REVISION2; > > > > -- > > 2.34.1 > > --0000000000003b131e05fd9b6a2b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Yes, I have already noted to update this patch on the same= lines as discussed in context of=C2=A0https://edk2.gro= ups.io/g/devel/topic/99293622

On Thu, Jun 8, 2023 at 12:48=E2=80=AFPM Wu= , Hao A <hao.a.wu@intel.com>= ; wrote:
> --= ---Original Message-----
> From: Ranbir Singh <rsingh@ventanamicro.com>
> Sent: Saturday, June 3, 2023 12:09 AM
> To: devel@ed= k2.groups.io; rsingh@ventanamicro.com
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [PATCH 1/1] MdeModulePkg/Bus/Ata/AtaBusDxe: Fix
> SIGN_EXTENSION Coverity issue
>
> From: Ranbir Singh <Ranbir.Singh3@Dell.com>
>
> Line number 365 does contain a typecast with UINT32, but it is after > all the operations (16-bit left shift followed by OR'ing) are over= .
> To avoid any SIGN_EXTENSION, typecast the intermediate result after > 16-bit left shift operation immediately with UINT32.
>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <r= ay.ni@intel.com>
> REF: https://bugzilla.tianocore.org/show_b= ug.cgi?id=3D4209
> Signed-off-by: Ranbir Singh <Ranbir.Singh3@Dell.com>
> ---
>=C2=A0 MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c | 2 +-
>=C2=A0 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c
> b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c
> index a77852bae054..ccd4c5f05b59 100644
> --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c
> +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c
> @@ -362,7 +362,7 @@ IdentifyAtaDevice (
>=C2=A0 =C2=A0 =C2=A0 // Check logical block size
>
>=C2=A0 =C2=A0 =C2=A0 //
>
>=C2=A0 =C2=A0 =C2=A0 if ((PhyLogicSectorSupport & BIT12) !=3D 0) {<= br> >
> -=C2=A0 =C2=A0 =C2=A0 BlockMedia->BlockSize =3D (UINT32)(((Identify= Data->logic_sector_size_hi
> << 16) | IdentifyData->logic_sector_size_lo) * sizeof (UINT16= ));
>
> +=C2=A0 =C2=A0 =C2=A0 BlockMedia->BlockSize =3D (((UINT32)(Identify= Data->logic_sector_size_hi
> << 16) | IdentifyData->logic_sector_size_lo) * sizeof (UINT16= ));
>
>=C2=A0 =C2=A0 =C2=A0 }


This patch seems to have the same issue with the concern raised in https://edk2.groups.io/g/devel/topic/99293622.

Best Regards,
Hao Wu


>
>
>
>=C2=A0 =C2=A0 =C2=A0 AtaDevice->BlockIo.Revision =3D EFI_BLOCK_IO_PR= OTOCOL_REVISION2;
>
> --
> 2.34.1

--0000000000003b131e05fd9b6a2b--