public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: cinnamon shia <cinnamon.shia@hpe.com>, edk2-devel@lists.01.org
Cc: star.zeng@intel.com, Ansen Huang <ansen.huang@hpe.com>
Subject: Re: [PATCH v2 1/2] MdeModulePkg Variable: Fix a corner case issue about setting a variable
Date: Sat, 12 May 2018 21:52:08 +0200	[thread overview]
Message-ID: <b972f4f3-f5ef-0399-2ae4-55b1ff11111c@redhat.com> (raw)
In-Reply-To: <20180511152112.33156-1-cinnamon.shia@hpe.com>

Hi Cinnamon,

On 05/11/18 17:21, cinnamon shia wrote:
> Fix the issue that failed to update or add a UEFI variable if the remaining size is equal to the data size
> of the variable.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: cinnamon shia <cinnamon.shia@hpe.com>
> Signed-off-by: Ansen Huang <ansen.huang@hpe.com>
> ---
>  MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> index 6caf603b3d..7303681aaa 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> @@ -17,7 +17,7 @@
>    integer overflow. It should also check attribute to avoid authentication bypass.
>  
>  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
> -(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
> +(C) Copyright 2015-2018 Hewlett Packard Enterprise Development LP<BR>
>  This program and the accompanying materials
>  are licensed and made available under the terms and conditions of the BSD License
>  which accompanies this distribution.  The full text of the license may be found at
> @@ -288,7 +288,7 @@ UpdateVariableStore (
>        DataPtr += mVariableModuleGlobal->VariableGlobal.NonVolatileVariableBase;
>      }
>  
> -    if ((DataPtr + DataSize) >= ((EFI_PHYSICAL_ADDRESS) (UINTN) ((UINT8 *) FwVolHeader + FwVolHeader->FvLength))) {
> +    if ((DataPtr + DataSize) > ((EFI_PHYSICAL_ADDRESS) (UINTN) ((UINT8 *) FwVolHeader + FwVolHeader->FvLength))) {
>        return EFI_INVALID_PARAMETER;
>      }
>    } else {
> @@ -301,7 +301,7 @@ UpdateVariableStore (
>        DataPtr += mVariableModuleGlobal->VariableGlobal.VolatileVariableBase;
>      }
>  
> -    if ((DataPtr + DataSize) >= ((UINTN) ((UINT8 *) VolatileBase + VolatileBase->Size))) {
> +    if ((DataPtr + DataSize) > ((UINTN) ((UINT8 *) VolatileBase + VolatileBase->Size))) {
>        return EFI_INVALID_PARAMETER;
>      }
>  
> 

the series looks OK to me on a quick skim, but I prefer that the
MdeModulePkg maintainers review this, if that's OK with you.

Thanks
Laszlo


  parent reply	other threads:[~2018-05-12 19:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-11 15:21 [PATCH v2 1/2] MdeModulePkg Variable: Fix a corner case issue about setting a variable cinnamon shia
2018-05-11 15:21 ` [PATCH v2 2/2] MdeModulePkg Variable: Fix the returned status in UpdateVariableStore cinnamon shia
2018-05-12 19:52 ` Laszlo Ersek [this message]
2018-05-14  2:07 ` [PATCH v2 1/2] MdeModulePkg Variable: Fix a corner case issue about setting a variable Zeng, Star

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=b972f4f3-f5ef-0399-2ae4-55b1ff11111c@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