From nobody Sat Nov 2 12:30:25 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490979957681799.2371837646451; Fri, 31 Mar 2017 10:05:57 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 69BFA21A0482F; Fri, 31 Mar 2017 10:05:53 -0700 (PDT) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5FDC921A04826 for ; Fri, 31 Mar 2017 10:05:48 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Mar 2017 10:05:47 -0700 Received: from shwde6388.ccr.corp.intel.com ([10.239.9.17]) by fmsmga004.fm.intel.com with ESMTP; 31 Mar 2017 10:05:45 -0700 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490979948; x=1522515948; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=HV7FN2nMbXFOQuxpULF85tfDoXuSXOMSqzhmN1zudE0=; b=ttgDEKYUZA29oEGFxwEZCMvHtInad58U1lVXpxVDTjRIdBYdzo2LTvOv M/4H2WigJTz29a4wzOBJfwTh+GJfjw==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,252,1486454400"; d="scan'208";a="242519957" From: Qin Long To: edk2-devel@lists.01.org Date: Sat, 1 Apr 2017 01:05:16 +0800 Message-Id: <20170331170517.4672-4-qin.long@intel.com> X-Mailer: git-send-email 2.12.2.windows.1 In-Reply-To: <20170331170517.4672-1-qin.long@intel.com> References: <20170331170517.4672-1-qin.long@intel.com> Subject: [edk2] [Patch 3/4] CryptoPkg/BaseCryptLib: Adding NULL checking in timer() wrapper. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ting.ye@intel.com, hao.a.wu@intel.com, feng.tian@intel.com, lersek@redhat.com, eric.dong@intel.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" There are some explicit timer(NULL) calls in openssl-1.1.0xx source, but the dummy timer() wrapper in ConstantTimeClock.c (used by PEI and SMM module) has no any checks on NULL parameter. This will cause the memory access issue. This patch adds the NULL parameter checking in timer() wrapper. Cc: Ting Ye Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qin Long --- CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c b/C= ryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c index 7f20164999..0cd90434ca 100644 --- a/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c +++ b/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c @@ -31,8 +31,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHE= R EXPRESS OR IMPLIED. =20 time_t time (time_t *timer) { - *timer =3D 0; - return *timer; + if (timer !=3D NULL) { + *timer =3D 0; + } + return 0; } =20 struct tm * gmtime (const time_t *timer) --=20 2.12.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel