<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/firmware, branch v3.4.61</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/firmware?h=v3.4.61</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/firmware?h=v3.4.61'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-04-05T17:04:36Z</updated>
<entry>
<title>efivars: Handle duplicate names from get_next_variable()</title>
<updated>2013-04-05T17:04:36Z</updated>
<author>
<name>Matt Fleming</name>
<email>matt.fleming@intel.com</email>
</author>
<published>2013-03-07T11:59:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4025b05599996ca2866ceec0606c77d2ce2b4830'/>
<id>urn:sha1:4025b05599996ca2866ceec0606c77d2ce2b4830</id>
<content type='text'>
commit e971318bbed610e28bb3fde9d548e6aaf0a6b02e upstream.

Some firmware exhibits a bug where the same VariableName and
VendorGuid values are returned on multiple invocations of
GetNextVariableName(). See,

    https://bugzilla.kernel.org/show_bug.cgi?id=47631

As a consequence of such a bug, Andre reports hitting the following
WARN_ON() in the sysfs code after updating the BIOS on his, "Gigabyte
Technology Co., Ltd. To be filled by O.E.M./Z77X-UD3H, BIOS F19e
11/21/2012)" machine,

[    0.581554] EFI Variables Facility v0.08 2004-May-17
[    0.584914] ------------[ cut here ]------------
[    0.585639] WARNING: at /home/andre/linux/fs/sysfs/dir.c:536 sysfs_add_one+0xd4/0x100()
[    0.586381] Hardware name: To be filled by O.E.M.
[    0.587123] sysfs: cannot create duplicate filename '/firmware/efi/vars/SbAslBufferPtrVar-01f33c25-764d-43ea-aeea-6b5a41f3f3e8'
[    0.588694] Modules linked in:
[    0.589484] Pid: 1, comm: swapper/0 Not tainted 3.8.0+ #7
[    0.590280] Call Trace:
[    0.591066]  [&lt;ffffffff81208954&gt;] ? sysfs_add_one+0xd4/0x100
[    0.591861]  [&lt;ffffffff810587bf&gt;] warn_slowpath_common+0x7f/0xc0
[    0.592650]  [&lt;ffffffff810588bc&gt;] warn_slowpath_fmt+0x4c/0x50
[    0.593429]  [&lt;ffffffff8134dd85&gt;] ? strlcat+0x65/0x80
[    0.594203]  [&lt;ffffffff81208954&gt;] sysfs_add_one+0xd4/0x100
[    0.594979]  [&lt;ffffffff81208b78&gt;] create_dir+0x78/0xd0
[    0.595753]  [&lt;ffffffff81208ec6&gt;] sysfs_create_dir+0x86/0xe0
[    0.596532]  [&lt;ffffffff81347e4c&gt;] kobject_add_internal+0x9c/0x220
[    0.597310]  [&lt;ffffffff81348307&gt;] kobject_init_and_add+0x67/0x90
[    0.598083]  [&lt;ffffffff81584a71&gt;] ? efivar_create_sysfs_entry+0x61/0x1c0
[    0.598859]  [&lt;ffffffff81584b2b&gt;] efivar_create_sysfs_entry+0x11b/0x1c0
[    0.599631]  [&lt;ffffffff8158517e&gt;] register_efivars+0xde/0x420
[    0.600395]  [&lt;ffffffff81d430a7&gt;] ? edd_init+0x2f5/0x2f5
[    0.601150]  [&lt;ffffffff81d4315f&gt;] efivars_init+0xb8/0x104
[    0.601903]  [&lt;ffffffff8100215a&gt;] do_one_initcall+0x12a/0x180
[    0.602659]  [&lt;ffffffff81d05d80&gt;] kernel_init_freeable+0x13e/0x1c6
[    0.603418]  [&lt;ffffffff81d05586&gt;] ? loglevel+0x31/0x31
[    0.604183]  [&lt;ffffffff816a6530&gt;] ? rest_init+0x80/0x80
[    0.604936]  [&lt;ffffffff816a653e&gt;] kernel_init+0xe/0xf0
[    0.605681]  [&lt;ffffffff816ce7ec&gt;] ret_from_fork+0x7c/0xb0
[    0.606414]  [&lt;ffffffff816a6530&gt;] ? rest_init+0x80/0x80
[    0.607143] ---[ end trace 1609741ab737eb29 ]---

There's not much we can do to work around and keep traversing the
variable list once we hit this firmware bug. Our only solution is to
terminate the loop because, as Lingzhu reports, some machines get
stuck when they encounter duplicate names,

  &gt; I had an IBM System x3100 M4 and x3850 X5 on which kernel would
  &gt; get stuck in infinite loop creating duplicate sysfs files because,
  &gt; for some reason, there are several duplicate boot entries in nvram
  &gt; getting GetNextVariableName into a circle of iteration (with
  &gt; period &gt; 2).

Also disable the workqueue, as efivar_update_sysfs_entries() uses
GetNextVariableName() to figure out which variables have been created
since the last iteration. That algorithm isn't going to work if
GetNextVariableName() returns duplicates. Note that we don't disable
EFI variable creation completely on the affected machines, it's just
that any pstore dump-* files won't appear in sysfs until the next
boot.

[Backported for 3.4-stable. Removed code related to pstore
workqueue but pulled in helper function variable_is_present
from a93bc0c; Moved the definition of __efivars to the top
for being referenced in variable_is_present.]

Reported-by: Andre Heider &lt;a.heider@gmail.com&gt;
Reported-by: Lingzhu Xiang &lt;lxiang@redhat.com&gt;
Tested-by: Lingzhu Xiang &lt;lxiang@redhat.com&gt;
Cc: Seiji Aguchi &lt;seiji.aguchi@hds.com&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
Signed-off-by: Lingzhu Xiang &lt;lxiang@redhat.com&gt;
Reviewed-by: CAI Qian &lt;caiqian@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;


</content>
</entry>
<entry>
<title>efivars: explicitly calculate length of VariableName</title>
<updated>2013-04-05T17:04:36Z</updated>
<author>
<name>Matt Fleming</name>
<email>matt.fleming@intel.com</email>
</author>
<published>2013-03-01T14:49:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5c44dddefa48c1a9541e3e451a0f395c6cc57ea0'/>
<id>urn:sha1:5c44dddefa48c1a9541e3e451a0f395c6cc57ea0</id>
<content type='text'>
commit ec50bd32f1672d38ddce10fb1841cbfda89cfe9a upstream.

It's not wise to assume VariableNameSize represents the length of
VariableName, as not all firmware updates VariableNameSize in the same
way (some don't update it at all if EFI_SUCCESS is returned). There
are even implementations out there that update VariableNameSize with
values that are both larger than the string returned in VariableName
and smaller than the buffer passed to GetNextVariableName(), which
resulted in the following bug report from Michael Schroeder,

  &gt; On HP z220 system (firmware version 1.54), some EFI variables are
  &gt; incorrectly named :
  &gt;
  &gt; ls -d /sys/firmware/efi/vars/*8be4d* | grep -v -- -8be returns
  &gt; /sys/firmware/efi/vars/dbxDefault-pport8be4df61-93ca-11d2-aa0d-00e098032b8c
  &gt; /sys/firmware/efi/vars/KEKDefault-pport8be4df61-93ca-11d2-aa0d-00e098032b8c
  &gt; /sys/firmware/efi/vars/SecureBoot-pport8be4df61-93ca-11d2-aa0d-00e098032b8c
  &gt; /sys/firmware/efi/vars/SetupMode-Information8be4df61-93ca-11d2-aa0d-00e098032b8c

The issue here is that because we blindly use VariableNameSize without
verifying its value, we can potentially read garbage values from the
buffer containing VariableName if VariableNameSize is larger than the
length of VariableName.

Since VariableName is a string, we can calculate its size by searching
for the terminating NULL character.

[Backported for 3.8-stable. Removed workqueue code added in
a93bc0c 3.9-rc1.]

Reported-by: Frederic Crozat &lt;fcrozat@suse.com&gt;
Cc: Matthew Garrett &lt;mjg59@srcf.ucam.org&gt;
Cc: Josh Boyer &lt;jwboyer@redhat.com&gt;
Cc: Michael Schroeder &lt;mls@suse.com&gt;
Cc: Lee, Chun-Yi &lt;jlee@suse.com&gt;
Cc: Lingzhu Xiang &lt;lxiang@redhat.com&gt;
Cc: Seiji Aguchi &lt;seiji.aguchi@hds.com&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
Signed-off-by: Lingzhu Xiang &lt;lxiang@redhat.com&gt;
Reviewed-by: CAI Qian &lt;caiqian@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dmi_scan: fix missing check for _DMI_ signature in smbios_present()</title>
<updated>2013-03-14T18:29:51Z</updated>
<author>
<name>Ben Hutchings</name>
<email>ben@decadent.org.uk</email>
</author>
<published>2013-03-08T20:43:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d2c96b7257048e9a558f2ebe4fe884b51fd9016f'/>
<id>urn:sha1:d2c96b7257048e9a558f2ebe4fe884b51fd9016f</id>
<content type='text'>
commit a40e7cf8f06b4e322ba902e4e9f6a6b0c2daa907 upstream.

Commit 9f9c9cbb6057 ("drivers/firmware/dmi_scan.c: fetch dmi version
from SMBIOS if it exists") hoisted the check for "_DMI_" into
dmi_scan_machine(), which means that we don't bother to check for
"_DMI_" at offset 16 in an SMBIOS entry.  smbios_present() may also call
dmi_present() for an address where we found "_SM_", if it failed further
validation.

Check for "_DMI_" in smbios_present() before calling dmi_present().

[akpm@linux-foundation.org: fix build]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Reported-by: Tim McGrath &lt;tmhikaru@gmail.com&gt;
Tested-by: Tim Mcgrath &lt;tmhikaru@gmail.com&gt;
Cc: Zhenzhong Duan &lt;zhenzhong.duan@oracle.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>efi: Make 'efi_enabled' a function to query EFI facilities</title>
<updated>2013-02-14T18:48:53Z</updated>
<author>
<name>Matt Fleming</name>
<email>matt.fleming@intel.com</email>
</author>
<published>2012-11-14T09:42:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=739230186fa9d6999f88c53f0cb6d07ed4234fb0'/>
<id>urn:sha1:739230186fa9d6999f88c53f0cb6d07ed4234fb0</id>
<content type='text'>
commit 83e68189745ad931c2afd45d8ee3303929233e7f upstream.

Originally 'efi_enabled' indicated whether a kernel was booted from
EFI firmware. Over time its semantics have changed, and it now
indicates whether or not we are booted on an EFI machine with
bit-native firmware, e.g. 64-bit kernel with 64-bit firmware.

The immediate motivation for this patch is the bug report at,

    https://bugs.launchpad.net/ubuntu-cdimage/+bug/1040557

which details how running a platform driver on an EFI machine that is
designed to run under BIOS can cause the machine to become
bricked. Also, the following report,

    https://bugzilla.kernel.org/show_bug.cgi?id=47121

details how running said driver can also cause Machine Check
Exceptions. Drivers need a new means of detecting whether they're
running on an EFI machine, as sadly the expression,

    if (!efi_enabled)

hasn't been a sufficient condition for quite some time.

Users actually want to query 'efi_enabled' for different reasons -
what they really want access to is the list of available EFI
facilities.

For instance, the x86 reboot code needs to know whether it can invoke
the ResetSystem() function provided by the EFI runtime services, while
the ACPI OSL code wants to know whether the EFI config tables were
mapped successfully. There are also checks in some of the platform
driver code to simply see if they're running on an EFI machine (which
would make it a bad idea to do BIOS-y things).

This patch is a prereq for the samsung-laptop fix patch.

Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: Corentin Chary &lt;corentincj@iksaif.net&gt;
Cc: Matthew Garrett &lt;mjg59@srcf.ucam.org&gt;
Cc: Dave Jiang &lt;dave.jiang@intel.com&gt;
Cc: Olof Johansson &lt;olof@lixom.net&gt;
Cc: Peter Jones &lt;pjones@redhat.com&gt;
Cc: Colin Ian King &lt;colin.king@canonical.com&gt;
Cc: Steve Langasek &lt;steve.langasek@canonical.com&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Konrad Rzeszutek Wilk &lt;konrad@kernel.org&gt;
Cc: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>drivers/firmware/dmi_scan.c: fetch dmi version from SMBIOS if it exists</title>
<updated>2013-01-28T04:47:44Z</updated>
<author>
<name>Zhenzhong Duan</name>
<email>zhenzhong.duan@oracle.com</email>
</author>
<published>2012-12-20T23:05:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b88532f7efaff806193edbbe826ef0d0f8ac1063'/>
<id>urn:sha1:b88532f7efaff806193edbbe826ef0d0f8ac1063</id>
<content type='text'>
commit 9f9c9cbb60576a1518d0bf93fb8e499cffccf377 upstream.

The right dmi version is in SMBIOS if it's zero in DMI region

This issue was originally found from an oracle bug.
One customer noticed system UUID doesn't match between dmidecode &amp; uek2.

 - HP ProLiant BL460c G6 :
   # cat /sys/devices/virtual/dmi/id/product_uuid
   00000000-0000-4C48-3031-4D5030333531
   # dmidecode | grep -i uuid
   UUID: 00000000-0000-484C-3031-4D5030333531

From SMBIOS 2.6 on, spec use little-endian encoding for UUID other than
network byte order.

So we need to get dmi version to distinguish.  If version is 0.0, the
real version is taken from the SMBIOS version.  This is part of original
kernel comment in code.

[akpm@linux-foundation.org: checkpatch fixes]
Signed-off-by: Zhenzhong Duan &lt;zhenzhong.duan@oracle.com&gt;
Cc: Feng Jin &lt;joe.jin@oracle.com&gt;
Cc: Jean Delvare &lt;khali@linux-fr.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Abdallah Chatila &lt;abdallah.chatila@ericsson.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>drivers/firmware/dmi_scan.c: check dmi version when get system uuid</title>
<updated>2013-01-28T04:47:44Z</updated>
<author>
<name>Zhenzhong Duan</name>
<email>zhenzhong.duan@oracle.com</email>
</author>
<published>2012-12-20T23:05:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=220a0bc2df2b7385d278864fa1f8b47f9c78c8a2'/>
<id>urn:sha1:220a0bc2df2b7385d278864fa1f8b47f9c78c8a2</id>
<content type='text'>
commit f1d8e614d74b09531b9a85e812485340f3df7b1c upstream.

As of version 2.6 of the SMBIOS specification, the first 3 fields of the
UUID are supposed to be little-endian encoded.

Also a minor fix to match variable meaning and mute checkpatch.pl

[akpm@linux-foundation.org: tweak code comment]
Signed-off-by: Zhenzhong Duan &lt;zhenzhong.duan@oracle.com&gt;
Cc: Feng Jin &lt;joe.jin@oracle.com&gt;
Cc: Jean Delvare &lt;khali@linux-fr.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Abdallah Chatila &lt;abdallah.chatila@ericsson.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>firmware: Add missing attributes to EFI variable attribute print out from sysfs</title>
<updated>2012-10-07T15:32:26Z</updated>
<author>
<name>Khalid Aziz</name>
<email>khalid.aziz@hp.com</email>
</author>
<published>2012-09-10T18:52:42Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ed02004f896be60f6d5dc3af403999f56a3e6d37'/>
<id>urn:sha1:ed02004f896be60f6d5dc3af403999f56a3e6d37</id>
<content type='text'>
commit 7083909023bbe29b3176e92d2d089def1aa7aa1e upstream.

Some of the EFI variable attributes are missing from print out from
/sys/firmware/efi/vars/*/attributes. This patch adds those in. It also
updates code to use pre-defined constants for masking current value
of attributes.

Signed-off-by: Khalid Aziz &lt;khalid.aziz@hp.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Acked-by: Matthew Garrett &lt;mjg@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dmi: Feed DMI table to /dev/random driver</title>
<updated>2012-08-15T15:10:30Z</updated>
<author>
<name>Tony Luck</name>
<email>tony.luck@intel.com</email>
</author>
<published>2012-07-20T20:15:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=af2eb889f75b4206de39ea86f4f154498a9327f3'/>
<id>urn:sha1:af2eb889f75b4206de39ea86f4f154498a9327f3</id>
<content type='text'>
commit d114a33387472555188f142ed8e98acdb8181c6d upstream.

Send the entire DMI (SMBIOS) table to the /dev/random driver to
help seed its pools.

Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>pcdp: use early_ioremap/early_iounmap to access pcdp table</title>
<updated>2012-08-15T15:10:05Z</updated>
<author>
<name>Greg Pearson</name>
<email>greg.pearson@hp.com</email>
</author>
<published>2012-07-30T21:39:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=603cb88c3a73968a0fa498e252cbb781e62bb5b4'/>
<id>urn:sha1:603cb88c3a73968a0fa498e252cbb781e62bb5b4</id>
<content type='text'>
commit 6c4088ac3a4d82779903433bcd5f048c58fb1aca upstream.

efi_setup_pcdp_console() is called during boot to parse the HCDP/PCDP
EFI system table and setup an early console for printk output.  The
routine uses ioremap/iounmap to setup access to the HCDP/PCDP table
information.

The call to ioremap is happening early in the boot process which leads
to a panic on x86_64 systems:

    panic+0x01ca
    do_exit+0x043c
    oops_end+0x00a7
    no_context+0x0119
    __bad_area_nosemaphore+0x0138
    bad_area_nosemaphore+0x000e
    do_page_fault+0x0321
    page_fault+0x0020
    reserve_memtype+0x02a1
    __ioremap_caller+0x0123
    ioremap_nocache+0x0012
    efi_setup_pcdp_console+0x002b
    setup_arch+0x03a9
    start_kernel+0x00d4
    x86_64_start_reservations+0x012c
    x86_64_start_kernel+0x00fe

This replaces the calls to ioremap/iounmap in efi_setup_pcdp_console()
with calls to early_ioremap/early_iounmap which can be called during
early boot.

This patch was tested on an x86_64 prototype system which uses the
HCDP/PCDP table for early console setup.

Signed-off-by: Greg Pearson &lt;greg.pearson@hp.com&gt;
Acked-by: Khalid Aziz &lt;khalid.aziz@hp.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>efivars: Improve variable validation</title>
<updated>2012-05-04T00:19:19Z</updated>
<author>
<name>Matthew Garrett</name>
<email>mjg@redhat.com</email>
</author>
<published>2012-05-03T20:50:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=54b3a4d311c98ad94b737802a8b5f2c8c6bfd627'/>
<id>urn:sha1:54b3a4d311c98ad94b737802a8b5f2c8c6bfd627</id>
<content type='text'>
Ben Hutchings pointed out that the validation in efivars was inadequate -
most obviously, an entry with size 0 would server as a DoS against the
kernel. Improve this based on his suggestions.

Signed-off-by: Matthew Garrett &lt;mjg@redhat.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
