linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Add missing attributes to EFI variable attribute print out from sysfs
@ 2012-07-13 17:42 Khalid Aziz
  2012-07-13 17:50 ` Matthew Garrett
  2012-09-10 17:55 ` Mike Waychison
  0 siblings, 2 replies; 12+ messages in thread
From: Khalid Aziz @ 2012-07-13 17:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: tony.luck, mikew, mjg, keescook, gong.chen

Some of the EFI variable attributes are missing from print out from
/sys/firmware/efi/vars/*/attributes. This patch adds those in. It also
updates code to use pre-defined constants for masking current value
of attributes.

Signed-off-by: Khalid Aziz <khalid.aziz@hp.com>
Cc: stable@vger.kernel.org
---
 drivers/firmware/efivars.c |   17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 47408e8..d10c987 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -435,12 +435,23 @@ efivar_attr_read(struct efivar_entry *entry, char *buf)
 	if (status != EFI_SUCCESS)
 		return -EIO;
 
-	if (var->Attributes & 0x1)
+	if (var->Attributes & EFI_VARIABLE_NON_VOLATILE)
 		str += sprintf(str, "EFI_VARIABLE_NON_VOLATILE\n");
-	if (var->Attributes & 0x2)
+	if (var->Attributes & EFI_VARIABLE_BOOTSERVICE_ACCESS)
 		str += sprintf(str, "EFI_VARIABLE_BOOTSERVICE_ACCESS\n");
-	if (var->Attributes & 0x4)
+	if (var->Attributes & EFI_VARIABLE_RUNTIME_ACCESS)
 		str += sprintf(str, "EFI_VARIABLE_RUNTIME_ACCESS\n");
+	if (var->Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD)
+		str += sprintf(str, "EFI_VARIABLE_HARDWARE_ERROR_RECORD\n");
+	if (var->Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS)
+		str += sprintf(str,
+			"EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS\n");
+	if (var->Attributes &
+			EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS)
+		str += sprintf(str,
+			"EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS\n");
+	if (var->Attributes & EFI_VARIABLE_APPEND_WRITE)
+		str += sprintf(str, "EFI_VARIABLE_APPEND_WRITE\n");
 	return str - buf;
 }
 
-- 
1.7.9.5

-- 
Khalid Aziz
khalid.aziz@hp.com

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Add missing attributes to EFI variable attribute print out from sysfs
  2012-07-13 17:42 [PATCH v2] Add missing attributes to EFI variable attribute print out from sysfs Khalid Aziz
@ 2012-07-13 17:50 ` Matthew Garrett
  2012-09-06 17:14   ` Khalid Aziz
  2012-09-10 17:55 ` Mike Waychison
  1 sibling, 1 reply; 12+ messages in thread
From: Matthew Garrett @ 2012-07-13 17:50 UTC (permalink / raw)
  To: Khalid Aziz; +Cc: linux-kernel, tony.luck, mikew, keescook, gong.chen

On Fri, Jul 13, 2012 at 11:42:16AM -0600, Khalid Aziz wrote:
> Some of the EFI variable attributes are missing from print out from
> /sys/firmware/efi/vars/*/attributes. This patch adds those in. It also
> updates code to use pre-defined constants for masking current value
> of attributes.
> 
> Signed-off-by: Khalid Aziz <khalid.aziz@hp.com>
> Cc: stable@vger.kernel.org
Acked-by: Matthew Garrett <mjg@redhat.com>
-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Add missing attributes to EFI variable attribute print out from sysfs
  2012-07-13 17:50 ` Matthew Garrett
@ 2012-09-06 17:14   ` Khalid Aziz
  0 siblings, 0 replies; 12+ messages in thread
From: Khalid Aziz @ 2012-09-06 17:14 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-kernel, tony.luck, mikew, keescook, gong.chen

On Fri, 2012-07-13 at 18:50 +0100, Matthew Garrett wrote:
> On Fri, Jul 13, 2012 at 11:42:16AM -0600, Khalid Aziz wrote:
> > Some of the EFI variable attributes are missing from print out from
> > /sys/firmware/efi/vars/*/attributes. This patch adds those in. It also
> > updates code to use pre-defined constants for masking current value
> > of attributes.
> > 
> > Signed-off-by: Khalid Aziz <khalid.aziz@hp.com>
> > Cc: stable@vger.kernel.org
> Acked-by: Matthew Garrett <mjg@redhat.com>

I have not seen this patch show up in linux-next or 3.6-rc*. Do I need
to do anything more to get this patch integrated?

Thanks
-- 
Khalid Aziz <khalid.aziz@hp.com>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Add missing attributes to EFI variable attribute print out from sysfs
  2012-07-13 17:42 [PATCH v2] Add missing attributes to EFI variable attribute print out from sysfs Khalid Aziz
  2012-07-13 17:50 ` Matthew Garrett
@ 2012-09-10 17:55 ` Mike Waychison
  2012-09-10 17:59   ` Mike Waychison
  1 sibling, 1 reply; 12+ messages in thread
From: Mike Waychison @ 2012-09-10 17:55 UTC (permalink / raw)
  To: Khalid Aziz, Greg Kroah-Hartman
  Cc: linux-kernel, Tony Luck, Matthew Garrett, Kees Cook, gong.chen

Greg,

Can you please pick this patch up in one of your trees?

Thanks!

Mike Waychison

On Fri, Jul 13, 2012 at 1:42 PM, Khalid Aziz <khalid.aziz@hp.com> wrote:
> Some of the EFI variable attributes are missing from print out from
> /sys/firmware/efi/vars/*/attributes. This patch adds those in. It also
> updates code to use pre-defined constants for masking current value
> of attributes.
>
> Signed-off-by: Khalid Aziz <khalid.aziz@hp.com>
> Cc: stable@vger.kernel.org
> ---
>  drivers/firmware/efivars.c |   17 ++++++++++++++---
>  1 file changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
> index 47408e8..d10c987 100644
> --- a/drivers/firmware/efivars.c
> +++ b/drivers/firmware/efivars.c
> @@ -435,12 +435,23 @@ efivar_attr_read(struct efivar_entry *entry, char *buf)
>         if (status != EFI_SUCCESS)
>                 return -EIO;
>
> -       if (var->Attributes & 0x1)
> +       if (var->Attributes & EFI_VARIABLE_NON_VOLATILE)
>                 str += sprintf(str, "EFI_VARIABLE_NON_VOLATILE\n");
> -       if (var->Attributes & 0x2)
> +       if (var->Attributes & EFI_VARIABLE_BOOTSERVICE_ACCESS)
>                 str += sprintf(str, "EFI_VARIABLE_BOOTSERVICE_ACCESS\n");
> -       if (var->Attributes & 0x4)
> +       if (var->Attributes & EFI_VARIABLE_RUNTIME_ACCESS)
>                 str += sprintf(str, "EFI_VARIABLE_RUNTIME_ACCESS\n");
> +       if (var->Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD)
> +               str += sprintf(str, "EFI_VARIABLE_HARDWARE_ERROR_RECORD\n");
> +       if (var->Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS)
> +               str += sprintf(str,
> +                       "EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS\n");
> +       if (var->Attributes &
> +                       EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS)
> +               str += sprintf(str,
> +                       "EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS\n");
> +       if (var->Attributes & EFI_VARIABLE_APPEND_WRITE)
> +               str += sprintf(str, "EFI_VARIABLE_APPEND_WRITE\n");
>         return str - buf;
>  }
>
> --
> 1.7.9.5
>
> --
> Khalid Aziz
> khalid.aziz@hp.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Add missing attributes to EFI variable attribute print out from sysfs
  2012-09-10 17:55 ` Mike Waychison
@ 2012-09-10 17:59   ` Mike Waychison
  2012-09-10 18:03     ` Greg KH
  0 siblings, 1 reply; 12+ messages in thread
From: Mike Waychison @ 2012-09-10 17:59 UTC (permalink / raw)
  To: Khalid Aziz, gregkh
  Cc: linux-kernel, Tony Luck, Matthew Garrett, Kees Cook, gong.chen

On Mon, Sep 10, 2012 at 1:55 PM, Mike Waychison <mikew@google.com> wrote:
> Greg,
>
> Can you please pick this patch up in one of your trees?

Resend using a good email addy for gregkh :)


>
> Thanks!
>
> Mike Waychison
>
> On Fri, Jul 13, 2012 at 1:42 PM, Khalid Aziz <khalid.aziz@hp.com> wrote:
>> Some of the EFI variable attributes are missing from print out from
>> /sys/firmware/efi/vars/*/attributes. This patch adds those in. It also
>> updates code to use pre-defined constants for masking current value
>> of attributes.
>>
>> Signed-off-by: Khalid Aziz <khalid.aziz@hp.com>
>> Cc: stable@vger.kernel.org
>> ---
>>  drivers/firmware/efivars.c |   17 ++++++++++++++---
>>  1 file changed, 14 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
>> index 47408e8..d10c987 100644
>> --- a/drivers/firmware/efivars.c
>> +++ b/drivers/firmware/efivars.c
>> @@ -435,12 +435,23 @@ efivar_attr_read(struct efivar_entry *entry, char *buf)
>>         if (status != EFI_SUCCESS)
>>                 return -EIO;
>>
>> -       if (var->Attributes & 0x1)
>> +       if (var->Attributes & EFI_VARIABLE_NON_VOLATILE)
>>                 str += sprintf(str, "EFI_VARIABLE_NON_VOLATILE\n");
>> -       if (var->Attributes & 0x2)
>> +       if (var->Attributes & EFI_VARIABLE_BOOTSERVICE_ACCESS)
>>                 str += sprintf(str, "EFI_VARIABLE_BOOTSERVICE_ACCESS\n");
>> -       if (var->Attributes & 0x4)
>> +       if (var->Attributes & EFI_VARIABLE_RUNTIME_ACCESS)
>>                 str += sprintf(str, "EFI_VARIABLE_RUNTIME_ACCESS\n");
>> +       if (var->Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD)
>> +               str += sprintf(str, "EFI_VARIABLE_HARDWARE_ERROR_RECORD\n");
>> +       if (var->Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS)
>> +               str += sprintf(str,
>> +                       "EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS\n");
>> +       if (var->Attributes &
>> +                       EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS)
>> +               str += sprintf(str,
>> +                       "EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS\n");
>> +       if (var->Attributes & EFI_VARIABLE_APPEND_WRITE)
>> +               str += sprintf(str, "EFI_VARIABLE_APPEND_WRITE\n");
>>         return str - buf;
>>  }
>>
>> --
>> 1.7.9.5
>>
>> --
>> Khalid Aziz
>> khalid.aziz@hp.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Add missing attributes to EFI variable attribute print out from sysfs
  2012-09-10 17:59   ` Mike Waychison
@ 2012-09-10 18:03     ` Greg KH
  2012-09-10 18:13       ` Khalid Aziz
  0 siblings, 1 reply; 12+ messages in thread
From: Greg KH @ 2012-09-10 18:03 UTC (permalink / raw)
  To: Mike Waychison
  Cc: Khalid Aziz, linux-kernel, Tony Luck, Matthew Garrett, Kees Cook,
	gong.chen

On Mon, Sep 10, 2012 at 01:59:18PM -0400, Mike Waychison wrote:
> On Mon, Sep 10, 2012 at 1:55 PM, Mike Waychison <mikew@google.com> wrote:
> > Greg,
> >
> > Can you please pick this patch up in one of your trees?
> 
> Resend using a good email addy for gregkh :)

Can someone resend it in a format that I can apply it in?  I can't find
the original anymore, sorry.

greg k-h

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Add missing attributes to EFI variable attribute print out from sysfs
  2012-09-10 18:03     ` Greg KH
@ 2012-09-10 18:13       ` Khalid Aziz
  2012-09-10 18:18         ` Greg KH
  0 siblings, 1 reply; 12+ messages in thread
From: Khalid Aziz @ 2012-09-10 18:13 UTC (permalink / raw)
  To: Greg KH
  Cc: Mike Waychison, linux-kernel, Tony Luck, Matthew Garrett,
	Kees Cook, gong.chen, khalid

On Mon, 2012-09-10 at 11:03 -0700, Greg KH wrote:
> On Mon, Sep 10, 2012 at 01:59:18PM -0400, Mike Waychison wrote:
> > On Mon, Sep 10, 2012 at 1:55 PM, Mike Waychison <mikew@google.com> wrote:
> > > Greg,
> > >
> > > Can you please pick this patch up in one of your trees?
> > 
> > Resend using a good email addy for gregkh :)
> 
> Can someone resend it in a format that I can apply it in?  I can't find
> the original anymore, sorry.
> 
> greg k-h

Some of the EFI variable attributes are missing from print out from
/sys/firmware/efi/vars/*/attributes. This patch adds those in. It also
updates code to use pre-defined constants for masking current value
of attributes.

Signed-off-by: Khalid Aziz <khalid.aziz@hp.com>
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 47408e8..d10c987 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -435,12 +435,23 @@ efivar_attr_read(struct efivar_entry *entry, char *buf)
 	if (status != EFI_SUCCESS)
 		return -EIO;
 
-	if (var->Attributes & 0x1)
+	if (var->Attributes & EFI_VARIABLE_NON_VOLATILE)
 		str += sprintf(str, "EFI_VARIABLE_NON_VOLATILE\n");
-	if (var->Attributes & 0x2)
+	if (var->Attributes & EFI_VARIABLE_BOOTSERVICE_ACCESS)
 		str += sprintf(str, "EFI_VARIABLE_BOOTSERVICE_ACCESS\n");
-	if (var->Attributes & 0x4)
+	if (var->Attributes & EFI_VARIABLE_RUNTIME_ACCESS)
 		str += sprintf(str, "EFI_VARIABLE_RUNTIME_ACCESS\n");
+	if (var->Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD)
+		str += sprintf(str, "EFI_VARIABLE_HARDWARE_ERROR_RECORD\n");
+	if (var->Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS)
+		str += sprintf(str,
+			"EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS\n");
+	if (var->Attributes &
+			EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS)
+		str += sprintf(str,
+			"EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS\n");
+	if (var->Attributes & EFI_VARIABLE_APPEND_WRITE)
+		str += sprintf(str, "EFI_VARIABLE_APPEND_WRITE\n");
 	return str - buf;
 }
 
--
1.7.9.5

-- 
Khalid Aziz <khalid.aziz@hp.com>


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Add missing attributes to EFI variable attribute print out from sysfs
  2012-09-10 18:13       ` Khalid Aziz
@ 2012-09-10 18:18         ` Greg KH
  2012-09-10 18:29           ` Khalid Aziz
  0 siblings, 1 reply; 12+ messages in thread
From: Greg KH @ 2012-09-10 18:18 UTC (permalink / raw)
  To: Khalid Aziz
  Cc: Mike Waychison, linux-kernel, Tony Luck, Matthew Garrett,
	Kees Cook, gong.chen, khalid

On Mon, Sep 10, 2012 at 12:13:09PM -0600, Khalid Aziz wrote:
> On Mon, 2012-09-10 at 11:03 -0700, Greg KH wrote:
> > On Mon, Sep 10, 2012 at 01:59:18PM -0400, Mike Waychison wrote:
> > > On Mon, Sep 10, 2012 at 1:55 PM, Mike Waychison <mikew@google.com> wrote:
> > > > Greg,
> > > >
> > > > Can you please pick this patch up in one of your trees?
> > > 
> > > Resend using a good email addy for gregkh :)
> > 
> > Can someone resend it in a format that I can apply it in?  I can't find
> > the original anymore, sorry.
> > 
> > greg k-h
> 
> Some of the EFI variable attributes are missing from print out from
> /sys/firmware/efi/vars/*/attributes. This patch adds those in. It also
> updates code to use pre-defined constants for masking current value
> of attributes.
> 
> Signed-off-by: Khalid Aziz <khalid.aziz@hp.com>
> diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
> index 47408e8..d10c987 100644

This isn't in a format I can apply it in, without having to edit the
heck out of the email by hand :(

Care to try it again, adding the different acks it picked up along the
review way, and send it, again as I asked for, in a format I can apply
it in?

greg k-h

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Add missing attributes to EFI variable attribute print out from sysfs
  2012-09-10 18:18         ` Greg KH
@ 2012-09-10 18:29           ` Khalid Aziz
  2012-09-10 18:35             ` Greg KH
  0 siblings, 1 reply; 12+ messages in thread
From: Khalid Aziz @ 2012-09-10 18:29 UTC (permalink / raw)
  To: Greg KH
  Cc: Mike Waychison, linux-kernel, Tony Luck, Matthew Garrett,
	Kees Cook, gong.chen, khalid

Some of the EFI variable attributes are missing from print out from
/sys/firmware/efi/vars/*/attributes. This patch adds those in. It also
updates code to use pre-defined constants for masking current value
of attributes.

Signed-off-by: Khalid Aziz <khalid.aziz@hp.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Matthew Garrett <mjg@redhat.com>
Cc: stable@vger.kernel.org
---
 drivers/firmware/efivars.c |   17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 47408e8..d10c987 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -435,12 +435,23 @@ efivar_attr_read(struct efivar_entry *entry, char *buf)
 	if (status != EFI_SUCCESS)
 		return -EIO;
 
-	if (var->Attributes & 0x1)
+	if (var->Attributes & EFI_VARIABLE_NON_VOLATILE)
 		str += sprintf(str, "EFI_VARIABLE_NON_VOLATILE\n");
-	if (var->Attributes & 0x2)
+	if (var->Attributes & EFI_VARIABLE_BOOTSERVICE_ACCESS)
 		str += sprintf(str, "EFI_VARIABLE_BOOTSERVICE_ACCESS\n");
-	if (var->Attributes & 0x4)
+	if (var->Attributes & EFI_VARIABLE_RUNTIME_ACCESS)
 		str += sprintf(str, "EFI_VARIABLE_RUNTIME_ACCESS\n");
+	if (var->Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD)
+		str += sprintf(str, "EFI_VARIABLE_HARDWARE_ERROR_RECORD\n");
+	if (var->Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS)
+		str += sprintf(str,
+			"EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS\n");
+	if (var->Attributes &
+			EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS)
+		str += sprintf(str,
+			"EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS\n");
+	if (var->Attributes & EFI_VARIABLE_APPEND_WRITE)
+		str += sprintf(str, "EFI_VARIABLE_APPEND_WRITE\n");
 	return str - buf;
 }
 
--
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Add missing attributes to EFI variable attribute print out from sysfs
  2012-09-10 18:29           ` Khalid Aziz
@ 2012-09-10 18:35             ` Greg KH
  2012-09-10 18:52               ` [PATCH v2 RESEND] " Khalid Aziz
  2012-09-10 18:58               ` [PATCH v2] " Khalid Aziz
  0 siblings, 2 replies; 12+ messages in thread
From: Greg KH @ 2012-09-10 18:35 UTC (permalink / raw)
  To: Khalid Aziz
  Cc: Mike Waychison, linux-kernel, Tony Luck, Matthew Garrett,
	Kees Cook, gong.chen, khalid

On Mon, Sep 10, 2012 at 12:29:14PM -0600, Khalid Aziz wrote:
> Some of the EFI variable attributes are missing from print out from
> /sys/firmware/efi/vars/*/attributes. This patch adds those in. It also
> updates code to use pre-defined constants for masking current value
> of attributes.
> 
> Signed-off-by: Khalid Aziz <khalid.aziz@hp.com>
> Reviewed-by: Kees Cook <keescook@chromium.org>
> Acked-by: Matthew Garrett <mjg@redhat.com>
> Cc: stable@vger.kernel.org
> ---
>  drivers/firmware/efivars.c |   17 ++++++++++++++---
>  1 file changed, 14 insertions(+), 3 deletions(-)
> diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
> index 47408e8..d10c987 100644

Ah, so close...

What's with the "Re:" in the Subject"?

And what happened to the extra line that should be after the diffstat
and before the "diff --" line?

Third time's a charm?

greg k-h

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 RESEND] Add missing attributes to EFI variable attribute print out from sysfs
  2012-09-10 18:35             ` Greg KH
@ 2012-09-10 18:52               ` Khalid Aziz
  2012-09-10 18:58               ` [PATCH v2] " Khalid Aziz
  1 sibling, 0 replies; 12+ messages in thread
From: Khalid Aziz @ 2012-09-10 18:52 UTC (permalink / raw)
  To: Greg KH
  Cc: Mike Waychison, linux-kernel, Tony Luck, Matthew Garrett,
	Kees Cook, gong.chen, khalid

Some of the EFI variable attributes are missing from print out from
/sys/firmware/efi/vars/*/attributes. This patch adds those in. It also
updates code to use pre-defined constants for masking current value
of attributes.

Signed-off-by: Khalid Aziz <khalid.aziz@hp.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Matthew Garrett <mjg@redhat.com>
Cc: stable@vger.kernel.org
---
 drivers/firmware/efivars.c |   17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 47408e8..d10c987 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -435,12 +435,23 @@ efivar_attr_read(struct efivar_entry *entry, char *buf)
 	if (status != EFI_SUCCESS)
 		return -EIO;
 
-	if (var->Attributes & 0x1)
+	if (var->Attributes & EFI_VARIABLE_NON_VOLATILE)
 		str += sprintf(str, "EFI_VARIABLE_NON_VOLATILE\n");
-	if (var->Attributes & 0x2)
+	if (var->Attributes & EFI_VARIABLE_BOOTSERVICE_ACCESS)
 		str += sprintf(str, "EFI_VARIABLE_BOOTSERVICE_ACCESS\n");
-	if (var->Attributes & 0x4)
+	if (var->Attributes & EFI_VARIABLE_RUNTIME_ACCESS)
 		str += sprintf(str, "EFI_VARIABLE_RUNTIME_ACCESS\n");
+	if (var->Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD)
+		str += sprintf(str, "EFI_VARIABLE_HARDWARE_ERROR_RECORD\n");
+	if (var->Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS)
+		str += sprintf(str,
+			"EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS\n");
+	if (var->Attributes &
+			EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS)
+		str += sprintf(str,
+			"EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS\n");
+	if (var->Attributes & EFI_VARIABLE_APPEND_WRITE)
+		str += sprintf(str, "EFI_VARIABLE_APPEND_WRITE\n");
 	return str - buf;
 }
 
--
1.7.9.5


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Add missing attributes to EFI variable attribute print out from sysfs
  2012-09-10 18:35             ` Greg KH
  2012-09-10 18:52               ` [PATCH v2 RESEND] " Khalid Aziz
@ 2012-09-10 18:58               ` Khalid Aziz
  1 sibling, 0 replies; 12+ messages in thread
From: Khalid Aziz @ 2012-09-10 18:58 UTC (permalink / raw)
  To: Greg KH
  Cc: Mike Waychison, linux-kernel, Tony Luck, Matthew Garrett,
	Kees Cook, gong.chen, khalid

On Mon, 2012-09-10 at 11:35 -0700, Greg KH wrote:
> On Mon, Sep 10, 2012 at 12:29:14PM -0600, Khalid Aziz wrote:
> > Some of the EFI variable attributes are missing from print out from
> > /sys/firmware/efi/vars/*/attributes. This patch adds those in. It also
> > updates code to use pre-defined constants for masking current value
> > of attributes.
> > 
> > Signed-off-by: Khalid Aziz <khalid.aziz@hp.com>
> > Reviewed-by: Kees Cook <keescook@chromium.org>
> > Acked-by: Matthew Garrett <mjg@redhat.com>
> > Cc: stable@vger.kernel.org
> > ---
> >  drivers/firmware/efivars.c |   17 ++++++++++++++---
> >  1 file changed, 14 insertions(+), 3 deletions(-)
> > diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
> > index 47408e8..d10c987 100644
> 
> Ah, so close...
> 
> What's with the "Re:" in the Subject"?
> 
> And what happened to the extra line that should be after the diffstat
> and before the "diff --" line?
> 
> Third time's a charm?

Sorry, Greg. I screwed up. I need to pay closer attention. Hopefully the
one I just sent out does the job.

-- 
Khalid Aziz <khalid.aziz@hp.com>


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-09-10 18:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-13 17:42 [PATCH v2] Add missing attributes to EFI variable attribute print out from sysfs Khalid Aziz
2012-07-13 17:50 ` Matthew Garrett
2012-09-06 17:14   ` Khalid Aziz
2012-09-10 17:55 ` Mike Waychison
2012-09-10 17:59   ` Mike Waychison
2012-09-10 18:03     ` Greg KH
2012-09-10 18:13       ` Khalid Aziz
2012-09-10 18:18         ` Greg KH
2012-09-10 18:29           ` Khalid Aziz
2012-09-10 18:35             ` Greg KH
2012-09-10 18:52               ` [PATCH v2 RESEND] " Khalid Aziz
2012-09-10 18:58               ` [PATCH v2] " Khalid Aziz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).