[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jK_mK_SCDQCQnG=y-yphy7kUT+on0pZbv4JpjS7jjpGwQ@mail.gmail.com>
Date: Sat, 1 Jun 2013 10:11:31 -0700
From: Kees Cook <keescook@...omium.org>
To: Thomas Meyer <thomas@...3r.de>
Cc: Anton Vorontsov <cbouatmailru@...il.com>,
Colin Cross <ccross@...roid.com>,
Tony Luck <tony.luck@...el.com>,
Matt Fleming <matt.fleming@...el.com>,
"linux-efi@...r.kernel.org" <linux-efi@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] efi, pstore: Cocci spatch "memdup.spatch"
On Sat, Jun 1, 2013 at 2:40 AM, Thomas Meyer <thomas@...3r.de> wrote:
>
> Signed-off-by: Thomas Meyer <thomas@...3r.de>
Acked-by: Kees Cook <keescook@...omium.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
--
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