public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] efi, pstore: Cocci spatch "memdup.spatch"
@ 2013-06-01  9:40 Thomas Meyer
  2013-06-01 17:11 ` Kees Cook
  2013-06-03 10:17 ` Matt Fleming
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Meyer @ 2013-06-01  9:40 UTC (permalink / raw)
  To: cbouatmailru, ccross, keescook, tony.luck, matt.fleming,
	linux-efi, linux-kernel


Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---

diff -u -p a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c
--- a/drivers/firmware/efi/efi-pstore.c
+++ b/drivers/firmware/efi/efi-pstore.c
@@ -79,10 +79,9 @@ static int efi_pstore_read_func(struct e
 			   &entry->var.DataSize, entry->var.Data);
 	size = entry->var.DataSize;
 
-	*cb_data->buf = kmalloc(size, GFP_KERNEL);
+	*cb_data->buf = kmemdup(entry->var.Data, size, GFP_KERNEL);
 	if (*cb_data->buf == NULL)
 		return -ENOMEM;
-	memcpy(*cb_data->buf, entry->var.Data, size);
 	return size;
 }
 




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

* Re: [PATCH] efi, pstore: Cocci spatch "memdup.spatch"
  2013-06-01  9:40 [PATCH] efi, pstore: Cocci spatch "memdup.spatch" Thomas Meyer
@ 2013-06-01 17:11 ` Kees Cook
  2013-06-03 10:17 ` Matt Fleming
  1 sibling, 0 replies; 4+ messages in thread
From: Kees Cook @ 2013-06-01 17:11 UTC (permalink / raw)
  To: Thomas Meyer
  Cc: Anton Vorontsov, Colin Cross, Tony Luck, Matt Fleming,
	linux-efi@vger.kernel.org, LKML

On Sat, Jun 1, 2013 at 2:40 AM, Thomas Meyer <thomas@m3y3r.de> wrote:
>
> Signed-off-by: Thomas Meyer <thomas@m3y3r.de>

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

Thanks!

-Kees

> ---
>
> diff -u -p a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c
> --- a/drivers/firmware/efi/efi-pstore.c
> +++ b/drivers/firmware/efi/efi-pstore.c
> @@ -79,10 +79,9 @@ static int efi_pstore_read_func(struct e
>                            &entry->var.DataSize, entry->var.Data);
>         size = entry->var.DataSize;
>
> -       *cb_data->buf = kmalloc(size, GFP_KERNEL);
> +       *cb_data->buf = kmemdup(entry->var.Data, size, GFP_KERNEL);
>         if (*cb_data->buf == NULL)
>                 return -ENOMEM;
> -       memcpy(*cb_data->buf, entry->var.Data, size);
>         return size;
>  }
>
>
>
>



--
Kees Cook
Chrome OS Security

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

* Re: [PATCH] efi, pstore: Cocci spatch "memdup.spatch"
  2013-06-01  9:40 [PATCH] efi, pstore: Cocci spatch "memdup.spatch" Thomas Meyer
  2013-06-01 17:11 ` Kees Cook
@ 2013-06-03 10:17 ` Matt Fleming
  2013-06-03 17:19   ` Luck, Tony
  1 sibling, 1 reply; 4+ messages in thread
From: Matt Fleming @ 2013-06-03 10:17 UTC (permalink / raw)
  To: Thomas Meyer
  Cc: cbouatmailru, ccross, keescook, tony.luck, matt.fleming,
	linux-efi, linux-kernel

On Sat, 01 Jun, at 11:40:02AM, Thomas Meyer wrote:
> 
> Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
> ---
> 
> diff -u -p a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c
> --- a/drivers/firmware/efi/efi-pstore.c
> +++ b/drivers/firmware/efi/efi-pstore.c
> @@ -79,10 +79,9 @@ static int efi_pstore_read_func(struct e
>  			   &entry->var.DataSize, entry->var.Data);
>  	size = entry->var.DataSize;
>  
> -	*cb_data->buf = kmalloc(size, GFP_KERNEL);
> +	*cb_data->buf = kmemdup(entry->var.Data, size, GFP_KERNEL);
>  	if (*cb_data->buf == NULL)
>  		return -ENOMEM;
> -	memcpy(*cb_data->buf, entry->var.Data, size);
>  	return size;
>  }

Who wants to pick this one up? Tony?

-- 
Matt Fleming, Intel Open Source Technology Center

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

* RE: [PATCH] efi, pstore: Cocci spatch "memdup.spatch"
  2013-06-03 10:17 ` Matt Fleming
@ 2013-06-03 17:19   ` Luck, Tony
  0 siblings, 0 replies; 4+ messages in thread
From: Luck, Tony @ 2013-06-03 17:19 UTC (permalink / raw)
  To: Matt Fleming, Thomas Meyer
  Cc: cbouatmailru@gmail.com, ccross@android.com, keescook@chromium.org,
	Fleming, Matt, linux-efi@vger.kernel.org,
	linux-kernel@vger.kernel.org

> Who wants to pick this one up? Tony?

Sure - I'll take it.

-Tony

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

end of thread, other threads:[~2013-06-03 17:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-01  9:40 [PATCH] efi, pstore: Cocci spatch "memdup.spatch" Thomas Meyer
2013-06-01 17:11 ` Kees Cook
2013-06-03 10:17 ` Matt Fleming
2013-06-03 17:19   ` Luck, Tony

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox