lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110607110428.86f92ee2.rdunlap@xenotime.net>
Date:	Tue, 7 Jun 2011 11:04:28 -0700
From:	Randy Dunlap <rdunlap@...otime.net>
To:	Matthew Garrett <mjg@...hat.com>
Cc:	tony.luck@...el.com, linux-kernel@...r.kernel.org,
	Matt_Domsch@...l.com
Subject: Re: [PATCH 3/3] efi: Add support for using efivars as a pstore
 backend

On Mon,  6 Jun 2011 15:38:55 -0400 Matthew Garrett wrote:

> EFI provides an area of nonvolatile storage managed by the firmware. We
> can use this as a pstore backend to maintain copies of oopses, aiding
> diagnosis.
> 
> Signed-off-by: Matthew Garrett <mjg@...hat.com>
> ---
>  drivers/firmware/efivars.c |  158 +++++++++++++++++++++++++++++++++++++++++++-
>  include/linux/efi.h        |    3 +
>  2 files changed, 159 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
> index 5f29aaf..89e6a3a 100644
> --- a/drivers/firmware/efivars.c
> +++ b/drivers/firmware/efivars.c
> @@ -161,18 +164,28 @@ utf8_strsize(efi_char16_t *data, unsigned long maxlength)
>  }
>  
>  static efi_status_t
> -get_var_data(struct efivars *efivars, struct efi_variable *var)
> +get_var_data_locked(struct efivars *efivars, struct efi_variable *var)

__get_var_data() would be a more common/typical name for this (unlocked,
needs locking version), I think.

>  {
>  	efi_status_t status;
>  
> -	spin_lock(&efivars->lock);
>  	var->DataSize = 1024;
>  	status = efivars->ops->get_variable(var->VariableName,
>  					    &var->VendorGuid,
>  					    &var->Attributes,
>  					    &var->DataSize,
>  					    var->Data);
> +	return status;
> +}
> +
> +static efi_status_t
> +get_var_data(struct efivars *efivars, struct efi_variable *var)
> +{
> +	efi_status_t status;
> +
> +	spin_lock(&efivars->lock);
> +	status = get_var_data_locked(efivars, var);
>  	spin_unlock(&efivars->lock);
> +
>  	if (status != EFI_SUCCESS) {
>  		printk(KERN_WARNING "efivars: get_variable() failed 0x%lx!\n",
>  			status);


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ