public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Nate DeSimone" <nathaniel.l.desimone@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Desimone, Nathaniel L" <nathaniel.l.desimone@intel.com>
Cc: "Bi, Dandan" <dandan.bi@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	"Jadhav, Manoj D" <manoj.d.jadhav@intel.com>,
	"Chiu, Chasel" <chasel.chiu@intel.com>
Subject: Re: [edk2-devel] [edk2-platforms] [PATCH v1] UserAuthFeaturePkg: VerifyPassword() allows one extra password attempt
Date: Wed, 8 Dec 2021 00:56:42 +0000	[thread overview]
Message-ID: <MW4PR11MB58212A2FFA500292E6E7F9BACD6F9@MW4PR11MB5821.namprd11.prod.outlook.com> (raw)
In-Reply-To: <16BCC34EE6738518.10763@groups.io>

Pushed: https://github.com/tianocore/edk2-platforms/commit/15d8aa1

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Nate
> DeSimone
> Sent: Wednesday, December 1, 2021 2:52 PM
> To: devel@edk2.groups.io
> Cc: Bi, Dandan <dandan.bi@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Jadhav, Manoj D
> <Manoj.D.Jadhav@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>
> Subject: [edk2-devel] [edk2-platforms] [PATCH v1] UserAuthFeaturePkg:
> VerifyPassword() allows one extra password attempt
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3756
> 
> If the password provided by the user is incorrect, then the VerifyPassword()
> function is supposed to return EFI_SECURITY_VIOLATION if the user has not
> exceeded the maximum number of password guesses (currently set to 3). If
> the number of password guesses has been exceeded, then
> VerifyPassword() shall return EFI_ACCESS_DENIED. UserAuthenticationDxe
> uses EFI_ACCESS_DENIED as the signal that the number of guesses has been
> exceeded for the purposes of triggering a forced reboot.
> 
> VerifyPassword() checks if the number of password guess attempts has
> exceeded the maximum allowed before checking if the current password
> guess is correct. If it has, then VerifyPassword() immediately returns
> EFI_ACCESS_DENIED. This behavior is correct since it is possible for
> VerifyPassword() to be called again after the maximum number of attempts
> has been exceeded. However, if the user guesses incorrectly, then
> VerifyPassword() will always return EFI_SECURITY_VIOLATION. This is where
> the bug is. It is possible that after the current attempt, the maximum allowed
> number of attempts is exceeded. Therefore,
> VerifyPassword() should check the number of attempts again, after checking
> if the password is correct.
> 
> Cc: Dandan Bi <dandan.bi@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Jadhav Manoj D <manoj.d.jadhav@intel.com>
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
> ---
>  .../UserAuthenticationSmm.c                        | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git
> a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDx
> eSmm/UserAuthenticationSmm.c
> b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDx
> eSmm/UserAuthenticationSmm.c
> index c24c3c47a5..16e3405a82 100644
> ---
> a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDx
> eSmm/UserAuthenticationSmm.c
> +++
> b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthentication
> +++ DxeSmm/UserAuthenticationSmm.c
> @@ -504,7 +504,12 @@ SmmPasswordHandler (
> 
>      if (!IsPasswordVerified (UserGuid,
> SmmCommunicateSetPassword.OldPassword, PasswordLen + 1)) {
>        DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: PasswordVerify -
> FAIL\n"));
> -      Status = EFI_SECURITY_VIOLATION;
> +      if (*PasswordTryCount >= PASSWORD_MAX_TRY_COUNT) {
> +        DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: SET_PASSWORD try
> count reach!\n"));
> +        Status = EFI_ACCESS_DENIED;
> +      } else {
> +        Status = EFI_SECURITY_VIOLATION;
> +      }
>        goto EXIT;
>      }
> 
> @@ -554,7 +559,12 @@ SmmPasswordHandler (
>      }
>      if (!IsPasswordVerified (UserGuid,
> SmmCommunicateVerifyPassword.Password, PasswordLen + 1)) {
>        DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: PasswordVerify -
> FAIL\n"));
> -      Status = EFI_SECURITY_VIOLATION;
> +      if (*PasswordTryCount >= PASSWORD_MAX_TRY_COUNT) {
> +        DEBUG ((DEBUG_ERROR, "SmmPasswordHandler: VERIFY_PASSWORD
> try count reach!\n"));
> +        Status = EFI_ACCESS_DENIED;
> +      } else {
> +        Status = EFI_SECURITY_VIOLATION;
> +      }
>        goto EXIT;
>      }
>      mPasswordVerified = TRUE;
> --
> 2.27.0.windows.1
> 
> 
> 
> 
> 


           reply	other threads:[~2021-12-08  0:56 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <16BCC34EE6738518.10763@groups.io>]

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=MW4PR11MB58212A2FFA500292E6E7F9BACD6F9@MW4PR11MB5821.namprd11.prod.outlook.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