public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Qin Long <qin.long@intel.com>, edk2-devel@lists.01.org
Cc: ting.ye@intel.com, hao.a.wu@intel.com, feng.tian@intel.com,
	eric.dong@intel.com
Subject: Re: [Patch 3/4] CryptoPkg/BaseCryptLib: Adding NULL checking in timer() wrapper.
Date: Fri, 31 Mar 2017 20:45:52 +0200	[thread overview]
Message-ID: <9812f014-580f-daad-fe58-4df3cbf76bf0@redhat.com> (raw)
In-Reply-To: <20170331170517.4672-4-qin.long@intel.com>

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 <ting.ye@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qin Long <qin.long@intel.com>
> ---
>  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 = 0;
> -  return *timer;
> +  if (timer != NULL) {
> +    *timer = 0;
> +  }
> +  return 0;
>  }
>  
>  struct tm * gmtime (const time_t *timer)
> 

This looks okay, except the function is called time(), not timer().
Please update the commit message (both subject line and body -- several
instances).

Thanks,
Laszlo


  reply	other threads:[~2017-03-31 18:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 17:05 [Patch 0/4] *** Resolving CryptoPkg build issues *** Qin Long
2017-03-31 17:05 ` [Patch 1/4] CryptoPkg/OpensslLib: Suppress extra build warnings in openssl source Qin Long
2017-03-31 18:23   ` Laszlo Ersek
2017-04-01  1:10     ` Long, Qin
2017-03-31 17:05 ` [Patch 2/4] CryptoPkg: Fix possible unresolved external symbol issue Qin Long
2017-03-31 18:44   ` Laszlo Ersek
2017-04-01  2:31     ` Long, Qin
2017-03-31 17:05 ` [Patch 3/4] CryptoPkg/BaseCryptLib: Adding NULL checking in timer() wrapper Qin Long
2017-03-31 18:45   ` Laszlo Ersek [this message]
2017-04-01  2:14     ` Long, Qin
2017-03-31 17:05 ` [Patch 4/4] CryptoPkg: One workaround to resolve potential build issue Qin Long
2017-03-31 18:50   ` Laszlo Ersek
2017-04-01  2:27     ` Long, Qin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9812f014-580f-daad-fe58-4df3cbf76bf0@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox