From nobody Sun Feb 8 01:21:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109105+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109105+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1695794778; cv=none; d=zohomail.com; s=zohoarc; b=kqyv4o+t7fMHWZOhKpw+Fy9uWNar1JKvGAtzjQQAgrjQVndP03YHLzaBDWJSD/XVvMxcAbKQAK2A1ErkznZlGs8hMIGskRoOpSYG1lq5kGLciUpCnzZk7JZOo5h3yFAvGF7GG2ndRUwG3MV2DXAIahzLBhMx2ygNC8+PHOZAe3o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695794778; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=570PKUL9qCOavNOg4DuyX/A+HnzbSVkYSNa+4zRiE0E=; b=kJqbEuqnTV3EKV7L2tPT4eCV0WkF7rvqf0QCjM/Eq2f923E+KwUd6IYmT9lc0K0AD7gk5gm/J18vzfo/aBlPiGV+8pSCIYNRW4z/DSG5IJc1rVuwzKNhdX58A1o+1CG0u9kK9J2rOBfm//Qwd9hFwSVzLK590++NMhiXXDYsE2s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109105+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1695794778484686.5086126751954; Tue, 26 Sep 2023 23:06:18 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=12XTOHxTU+1rj4KoThoICjAgk4OBT4w/AASmKTJxYMQ=; 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=CO88QgDGmCsXqpT3ukUvJr+idRko6j+vaQyXr0/pC22fMe9zOuzv8t00WSlZe4NAmPKg9HjE ST9e39b1lsucpys4fxscGGfMGGxV02bWguA+htf4auGpQYlFh8/p4OnvziznEanx8Vi3CuLG4Eh +4ZNRJ8azUJlp2TwNsGs59M8= X-Received: by 127.0.0.2 with SMTP id 26k3YY1788612xQqA3BoXdma; 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: 8Z9AsZ252zHNzgTH8fWZJAr8x1787277AA= 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-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1695794780544100007 Content-Type: text/plain; charset="utf-8" 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 (); } =20 - gEventPending &=3D ~(UINTN)(1 << Priority); + gEventPending &=3D ~(UINTN)((UINTN)1 << Priority); CoreReleaseEventLock (); } =20 @@ -225,7 +225,7 @@ CoreNotifyEvent ( // =20 InsertTailList (&gEventQueue[Event->NotifyTpl], &Event->NotifyLink); - gEventPending |=3D (UINTN)(1 << Event->NotifyTpl); + gEventPending |=3D (UINTN)((UINTN)1 << Event->NotifyTpl); } =20 /** --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- 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/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-