Linux EFI development
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
To: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: matthew.garrett-05XSO3Yj/JvQT0dZR+AlfA@public.gmane.org,
	linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: EFI: Stash ROMs if they're not in the PCI BAR
Date: Fri, 15 Mar 2013 08:57:52 +0000	[thread overview]
Message-ID: <1363337872.2444.9.camel@shinybook.infradead.org> (raw)
In-Reply-To: <20130315082928.GA14520-dZEljifmRObu9KfB+GxooP8+0UxHXcjY@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1630 bytes --]

On Fri, 2013-03-15 at 11:29 +0300, Dan Carpenter wrote:
> Hello Matthew Garrett,
> 
> The patch dd5fc854de5f: "EFI: Stash ROMs if they're not in the PCI 
> BAR" from Dec 5, 2012, leads to the following warning:
> "arch/x86/boot/compressed/eboot.c:290 setup_efi_pci()
> 	 error: potentially dereferencing uninitialized 'pci_handle'."
> 
>   254  static efi_status_t setup_efi_pci(struct boot_params *params)
>   255  {
>   256          efi_pci_io_protocol *pci;
>   257          efi_status_t status;
>   258          void **pci_handle;
>   259          efi_guid_t pci_proto = EFI_PCI_IO_PROTOCOL_GUID;
>   260          unsigned long nr_pci, size = 0;
>   261          int i;
>   262          struct setup_data *data;
>   263  
>   264          data = (struct setup_data *)(unsigned long)params->hdr.setup_data;
>   265  
>   266          while (data && data->next)
>   267                  data = (struct setup_data *)(unsigned long)data->next;
>   268  
>   269          status = efi_call_phys5(sys_table->boottime->locate_handle,
>   270                                  EFI_LOCATE_BY_PROTOCOL, &pci_proto,
>   271                                  NULL, &size, pci_handle);
>                                                     ^^^^^^^^^^
> This hasn't been initialized yet.

True. It probably doesn't *matter* because the size is zero so the
firmware is just going to ignore the pointer anyway. Although in that
case I wonder why we couldn't have just passed NULL. Perhaps we expected
that some firmware might do some validation on the pointer before
getting to the size check?

-- 
dwmw2


[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 6171 bytes --]

  parent reply	other threads:[~2013-03-15  8:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-15  8:29 EFI: Stash ROMs if they're not in the PCI BAR Dan Carpenter
     [not found] ` <20130315082928.GA14520-dZEljifmRObu9KfB+GxooP8+0UxHXcjY@public.gmane.org>
2013-03-15  8:57   ` David Woodhouse [this message]
     [not found]     ` <1363337872.2444.9.camel-Fexsq3y4057IgHVZqg5X0TlWvGAXklZc@public.gmane.org>
2013-03-18 11:36       ` Matt Fleming
     [not found]         ` <1363606563.15011.333.camel-ZqTwcBeJ+wsBof6jY8KHXm7IUlhRatedral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-03-18 16:02           ` Matthew Garrett
     [not found]             ` <1363622520.2553.8.camel-tCUS0Eywp2Pehftex57rkxo58HMYffqeLoYNBG0abjxeoWH0uzbU5w@public.gmane.org>
2013-03-20  8:44               ` Matt Fleming
     [not found]                 ` <514976F3.2-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2013-03-20  9:09                   ` Dan Carpenter
2013-03-20  9:27               ` David Woodhouse

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=1363337872.2444.9.camel@shinybook.infradead.org \
    --to=dwmw2-wegcikhe2lqwvfeawa7xhq@public.gmane.org \
    --cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matthew.garrett-05XSO3Yj/JvQT0dZR+AlfA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox