From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 67062740032 for ; Wed, 27 Sep 2023 06:06:19 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=+nB14VyN52t9+frk/bEjzi+sLlYPlF4xQaTN68A9Gr4=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1695794778; v=1; b=JuaVI9O43A4V3kJDOasOomzfpGG0A0Pew5hnJYt+ajVhnOmEzx8UUvndTkXMsiUFsQM/7/8s w/UID2Te7DRAQm2eXxrl+t0QIIk1WTMBSTDYJPsqrevNOA5ZhbnuOMrGX071/xmq1i+0nLj0abv ZI3/ehBFF1pzxjeMT2m700O8= X-Received: by 127.0.0.2 with SMTP id GA3jYY7687511xbwvKIAdlcJ; Tue, 26 Sep 2023 23:06:18 -0700 X-Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) by mx.groups.io with SMTP id smtpd.web11.11805.1695794777511756025 for ; Tue, 26 Sep 2023 23:06:17 -0700 X-Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-351574aca7bso7773805ab.3 for ; Tue, 26 Sep 2023 23:06:17 -0700 (PDT) X-Gm-Message-State: wOVQDIn8Y8riWKg8vwBBGcxBx7686176AA= X-Google-Smtp-Source: AGHT+IHvULPm3mN02bJqco4Ja1vS7aGlKpz1myImqcgUrn+rrkodIVthlysO8ayTznXppDApuDVryw== X-Received: by 2002:a92:c543:0:b0:351:5b43:5ecd with SMTP id a3-20020a92c543000000b003515b435ecdmr1175559ilj.14.1695794776632; Tue, 26 Sep 2023 23:06:16 -0700 (PDT) X-Received: from user-Latitude-5420.dc1.ventanamicro.com ([106.51.83.242]) by smtp.gmail.com with ESMTPSA id gj8-20020a0566386a0800b0042b39b2289asm3856707jab.102.2023.09.26.23.06.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 23:06:16 -0700 (PDT) From: "Ranbir Singh" To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Dandan Bi , Liming Gao , Veeresh Sangolli Subject: [edk2-devel] [PATCH v2 4/5] MdeModulePkg/Core/Dxe: Fix OVERFLOW_BEFORE_WIDEN Coverity issues Date: Wed, 27 Sep 2023 11:36:00 +0530 Message-Id: <20230927060601.443693-5-rsingh@ventanamicro.com> In-Reply-To: <20230927060601.443693-1-rsingh@ventanamicro.com> References: <20230927060601.443693-1-rsingh@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rsingh@ventanamicro.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=JuaVI9O4; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io From: Ranbir Singh "1 << Priority" / "1 << Event->NotifyTpl" are potentially overflowing expressions with type "int" (32 bits, signed) evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "UINTN" (64 bits, unsigned). To avoid overflow, cast "1" to type "UINTN" before << operation. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4219 Cc: Dandan Bi Cc: Liming Gao Co-authored-by: Veeresh Sangolli Signed-off-by: Ranbir Singh Signed-off-by: Ranbir Singh --- MdeModulePkg/Core/Dxe/Event/Event.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/Event/Event.c b/MdeModulePkg/Core/Dxe/Ev= ent/Event.c index dc82abb02130..6cf93f7f562d 100644 --- a/MdeModulePkg/Core/Dxe/Event/Event.c +++ b/MdeModulePkg/Core/Dxe/Event/Event.c @@ -191,7 +191,7 @@ CoreDispatchEventNotifies ( CoreAcquireEventLock ();=0D }=0D =0D - gEventPending &=3D ~(UINTN)(1 << Priority);=0D + gEventPending &=3D ~(UINTN)((UINTN)1 << Priority);=0D CoreReleaseEventLock ();=0D }=0D =0D @@ -225,7 +225,7 @@ CoreNotifyEvent ( //=0D =0D InsertTailList (&gEventQueue[Event->NotifyTpl], &Event->NotifyLink);=0D - gEventPending |=3D (UINTN)(1 << Event->NotifyTpl);=0D + gEventPending |=3D (UINTN)((UINTN)1 << Event->NotifyTpl);=0D }=0D =0D /**=0D --=20 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109105): https://edk2.groups.io/g/devel/message/109105 Mute This Topic: https://groups.io/mt/101612681/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-