From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 4C37321A04820 for ; Fri, 31 Mar 2017 19:14:37 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP; 31 Mar 2017 19:14:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,255,1486454400"; d="scan'208";a="1114205758" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 31 Mar 2017 19:14:36 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 31 Mar 2017 19:14:35 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 31 Mar 2017 19:14:34 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.253]) by shsmsx102.ccr.corp.intel.com ([169.254.2.212]) with mapi id 14.03.0248.002; Sat, 1 Apr 2017 10:14:31 +0800 From: "Long, Qin" To: Laszlo Ersek , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Wu, Hao A" , "Tian, Feng" , "Dong, Eric" Thread-Topic: [Patch 3/4] CryptoPkg/BaseCryptLib: Adding NULL checking in timer() wrapper. Thread-Index: AQHSqk8QkbzrO6sQ40Wg/cvwsM6FKqGvxnQw Date: Sat, 1 Apr 2017 02:14:31 +0000 Message-ID: References: <20170331170517.4672-1-qin.long@intel.com> <20170331170517.4672-4-qin.long@intel.com> <9812f014-580f-daad-fe58-4df3cbf76bf0@redhat.com> In-Reply-To: <9812f014-580f-daad-fe58-4df3cbf76bf0@redhat.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: , X-List-Received-Date: Sat, 01 Apr 2017 02:14:37 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Got it. Will correct the commit message. Thanks. > -----Original Message----- > From: Laszlo Ersek [mailto:lersek@redhat.com] > Sent: Saturday, April 01, 2017 2:46 AM > To: Long, Qin; edk2-devel@lists.01.org > Cc: Ye, Ting; Wu, Hao A; Tian, Feng; Dong, Eric > Subject: Re: [Patch 3/4] CryptoPkg/BaseCryptLib: Adding NULL checking in > timer() wrapper. >=20 > On 03/31/17 19:05, Qin Long wrote: > > 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/CryptoPkg/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, EITHER EXPRESS OR IMPLIED. > > > > time_t time (time_t *timer) > > { > > - *timer =3D 0; > > - return *timer; > > + if (timer !=3D NULL) { > > + *timer =3D 0; > > + } > > + return 0; > > } > > > > struct tm * gmtime (const time_t *timer) > > >=20 > This looks okay, except the function is called time(), not timer(). > Please update the commit message (both subject line and body -- several > instances). >=20 > Thanks, > Laszlo