Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1264734 > unrolled thread

[PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit()

Started byGeliang Tang <geliangtang@163.com>
First post2015-11-07 06:00 +0100
Last post2015-11-12 13:30 +0100
Articles 6 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit() Geliang Tang <geliangtang@163.com> - 2015-11-07 06:00 +0100
    Re: [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit() Matt Fleming <matt@codeblueprint.co.uk> - 2015-11-11 18:00 +0100
      Re: [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit() Kees Cook <keescook@chromium.org> - 2015-11-12 00:10 +0100
        RE: [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit() "Luck, Tony" <tony.luck@intel.com> - 2015-11-12 00:30 +0100
          Re: [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit() Kees Cook <keescook@chromium.org> - 2015-11-12 00:30 +0100
          Re: [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit() Matt Fleming <matt@codeblueprint.co.uk> - 2015-11-12 13:30 +0100

#1264734 — [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit()

FromGeliang Tang <geliangtang@163.com>
Date2015-11-07 06:00 +0100
Subject[PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit()
Message-ID<qs3Lz-608-9@gated-at.bofh.it>
The original efivars_pstore_exit() is empty. I
 1) add a bufsize check statement.
 2) call pstore_unregister as it is defined now.
 3) free the memory and set bufsize to 0.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/firmware/efi/efi-pstore.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c
index eac76a7..62d57d8 100644
--- a/drivers/firmware/efi/efi-pstore.c
+++ b/drivers/firmware/efi/efi-pstore.c
@@ -393,6 +393,13 @@ static __init int efivars_pstore_init(void)
 
 static __exit void efivars_pstore_exit(void)
 {
+	if (!efi_pstore_info.bufsize)
+		return;
+
+	pstore_unregister(&efi_pstore_info);
+	kfree(efi_pstore_info.buf);
+	efi_pstore_info.buf = NULL;
+	efi_pstore_info.bufsize = 0;
 }
 
 module_init(efivars_pstore_init);
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1267320

FromMatt Fleming <matt@codeblueprint.co.uk>
Date2015-11-11 18:00 +0100
Message-ID<qtGUz-5jq-23@gated-at.bofh.it>
In reply to#1264734
On Sat, 07 Nov, at 12:43:48PM, Geliang Tang wrote:
> The original efivars_pstore_exit() is empty. I
>  1) add a bufsize check statement.
>  2) call pstore_unregister as it is defined now.
>  3) free the memory and set bufsize to 0.
> 
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
>  drivers/firmware/efi/efi-pstore.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c
> index eac76a7..62d57d8 100644
> --- a/drivers/firmware/efi/efi-pstore.c
> +++ b/drivers/firmware/efi/efi-pstore.c
> @@ -393,6 +393,13 @@ static __init int efivars_pstore_init(void)
>  
>  static __exit void efivars_pstore_exit(void)
>  {
> +	if (!efi_pstore_info.bufsize)
> +		return;
> +
> +	pstore_unregister(&efi_pstore_info);
> +	kfree(efi_pstore_info.buf);
> +	efi_pstore_info.buf = NULL;
> +	efi_pstore_info.bufsize = 0;
>  }
>  
>  module_init(efivars_pstore_init);

Looks OK to me. Kees, are you picking this up?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1267525

FromKees Cook <keescook@chromium.org>
Date2015-11-12 00:10 +0100
Message-ID<qtMGB-Q4-5@gated-at.bofh.it>
In reply to#1267320
On Wed, Nov 11, 2015 at 8:59 AM, Matt Fleming <matt@codeblueprint.co.uk> wrote:
> On Sat, 07 Nov, at 12:43:48PM, Geliang Tang wrote:
>> The original efivars_pstore_exit() is empty. I
>>  1) add a bufsize check statement.
>>  2) call pstore_unregister as it is defined now.
>>  3) free the memory and set bufsize to 0.
>>
>> Signed-off-by: Geliang Tang <geliangtang@163.com>
>> ---
>>  drivers/firmware/efi/efi-pstore.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c
>> index eac76a7..62d57d8 100644
>> --- a/drivers/firmware/efi/efi-pstore.c
>> +++ b/drivers/firmware/efi/efi-pstore.c
>> @@ -393,6 +393,13 @@ static __init int efivars_pstore_init(void)
>>
>>  static __exit void efivars_pstore_exit(void)
>>  {
>> +     if (!efi_pstore_info.bufsize)
>> +             return;
>> +
>> +     pstore_unregister(&efi_pstore_info);
>> +     kfree(efi_pstore_info.buf);
>> +     efi_pstore_info.buf = NULL;
>> +     efi_pstore_info.bufsize = 0;
>>  }
>>
>>  module_init(efivars_pstore_init);
>
> Looks OK to me. Kees, are you picking this up?

I can, though usually it goes through Tony.

-Kees

-- 
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1267535

From"Luck, Tony" <tony.luck@intel.com>
Date2015-11-12 00:30 +0100
Message-ID<qtMZY-11K-1@gated-at.bofh.it>
In reply to#1267525
Pj4+ICBtb2R1bGVfaW5pdChlZml2YXJzX3BzdG9yZV9pbml0KTsNCj4+DQo+PiBMb29rcyBPSyB0
byBtZS4gS2VlcywgYXJlIHlvdSBwaWNraW5nIHRoaXMgdXA/DQo+DQo+IEkgY2FuLCB0aG91Z2gg
dXN1YWxseSBpdCBnb2VzIHRocm91Z2ggVG9ueS4NCg0KQ2FuIEkgY291bnQgdGhhdCBhcyAiQWNr
ZWQtYnkiIGZyb20gYm90aCBvZiB5b3U/DQoNCi1Ub255DQo=
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1267536

FromKees Cook <keescook@chromium.org>
Date2015-11-12 00:30 +0100
Message-ID<qtMZY-11K-3@gated-at.bofh.it>
In reply to#1267535
On Wed, Nov 11, 2015 at 3:23 PM, Luck, Tony <tony.luck@intel.com> wrote:
>>>>  module_init(efivars_pstore_init);
>>>
>>> Looks OK to me. Kees, are you picking this up?
>>
>> I can, though usually it goes through Tony.
>
> Can I count that as "Acked-by" from both of you?

Yup, sorry. I thought I'd acked them already. :) My bad!

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

-- 
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1267880

FromMatt Fleming <matt@codeblueprint.co.uk>
Date2015-11-12 13:30 +0100
Message-ID<qtZaP-nZ-25@gated-at.bofh.it>
In reply to#1267535
On Wed, 11 Nov, at 11:23:15PM, Luck, Tony wrote:
> >>>  module_init(efivars_pstore_init);
> >>
> >> Looks OK to me. Kees, are you picking this up?
> >
> > I can, though usually it goes through Tony.
> 
> Can I count that as "Acked-by" from both of you?

Yep, Acked-by: Matt Fleming <matt@codeblueprint.co.uk>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web