All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Peres <martin.peres-GANU6spQydw@public.gmane.org>
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Ben Skeggs <bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH] bios: fix a potential NULL deref in the PROM shadowing function
Date: Tue, 27 May 2014 11:15:57 +0200	[thread overview]
Message-ID: <538457CD.5080208@free.fr> (raw)
In-Reply-To: <1396555961-2252-1-git-send-email-martin.peres-GANU6spQydw@public.gmane.org>

Le 03/04/2014 22:12, Martin Peres a écrit :
> Reported-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Martin Peres <martin.peres-GANU6spQydw@public.gmane.org>
> ---
>   nvkm/subdev/bios/base.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/nvkm/subdev/bios/base.c b/nvkm/subdev/bios/base.c
> index 3de7d81..5f8643d 100644
> --- a/nvkm/subdev/bios/base.c
> +++ b/nvkm/subdev/bios/base.c
> @@ -183,10 +183,11 @@ nouveau_bios_shadow_prom(struct nouveau_bios *bios)
>   		goto out;
>
>   	bios->data = kmalloc(bios->size, GFP_KERNEL);
> -	if (bios->data) {
> -		for (i = 0; i < bios->size; i += 4)
> -			((u32 *)bios->data)[i/4] = nv_rd32(bios, 0x300000 + i);
> -	}
> +	if (!bios->data)
> +		goto out;
> +
> +	for (i = 0; i < bios->size; i += 4)
> +		((u32 *)bios->data)[i/4] = nv_rd32(bios, 0x300000 + i);
>
>   	/* check the PCI record header */
>   	pcir = nv_ro16(bios, 0x0018);
>

This patch never got reviewed or pushed. It should also be sent as a fix 
for the next 3.15 rc, if possible.

  parent reply	other threads:[~2014-05-27  9:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-03 20:12 [PATCH] bios: fix a potential NULL deref in the PROM shadowing function Martin Peres
     [not found] ` <1396555961-2252-1-git-send-email-martin.peres-GANU6spQydw@public.gmane.org>
2014-05-27  9:15   ` Martin Peres [this message]
     [not found]     ` <538457CD.5080208-GANU6spQydw@public.gmane.org>
2014-05-29 23:39       ` Ben Skeggs
     [not found]         ` <CACAvsv6SaRYhEp1QkWe_9H+XB1h8HQztZi-PP8FioE-1M2eAQA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-29 23:43           ` Martin Peres

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=538457CD.5080208@free.fr \
    --to=martin.peres-ganu6spqydw@public.gmane.org \
    --cc=bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.