public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] efi, pstore: Cocci spatch "memdup.spatch"
@ 2013-06-01  9:40 Thomas Meyer
       [not found] ` <1370079602.29224.8.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  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"
       [not found] ` <1370079602.29224.8.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2013-06-01 17:11   ` Kees Cook
  0 siblings, 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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, LKML

On Sat, Jun 1, 2013 at 2:40 AM, Thomas Meyer <thomas-VsYtu1Qij5c@public.gmane.org> wrote:
>
> Signed-off-by: Thomas Meyer <thomas-VsYtu1Qij5c@public.gmane.org>

Acked-by: Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.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
       [not found] ` <1370079602.29224.8.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2013-06-03 10:17 ` Matt Fleming
       [not found]   ` <20130603101756.GH2004-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
  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"
       [not found]   ` <20130603101756.GH2004-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
@ 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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org,
	keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, Fleming, Matt,
	linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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
     [not found] ` <1370079602.29224.8.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2013-06-01 17:11   ` Kees Cook
2013-06-03 10:17 ` Matt Fleming
     [not found]   ` <20130603101756.GH2004-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
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