<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/firmware, branch v3.9</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/firmware?h=v3.9</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/firmware?h=v3.9'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-04-26T15:02:03Z</updated>
<entry>
<title>efivars: only check for duplicates on the registered list</title>
<updated>2013-04-26T15:02:03Z</updated>
<author>
<name>Matt Fleming</name>
<email>matt.fleming@intel.com</email>
</author>
<published>2013-04-26T09:10:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f464246d85d5a5c0fdbf5838b8c58ef59bd82fcc'/>
<id>urn:sha1:f464246d85d5a5c0fdbf5838b8c58ef59bd82fcc</id>
<content type='text'>
variable_is_present() accesses '__efivars' directly, but when called via
gsmi_init() Michel reports observing the following crash,

  BUG: unable to handle kernel NULL pointer dereference at (null)
  IP: variable_is_present+0x55/0x170
  Call Trace:
    register_efivars+0x106/0x370
    gsmi_init+0x2ad/0x3da
    do_one_initcall+0x3f/0x170

The reason for the crash is that '__efivars' hasn't been initialised nor
has it been registered with register_efivars() by the time the google
EFI SMI driver runs.  The gsmi code uses its own struct efivars, and
therefore, a different variable list.  Fix the above crash by passing
the registered struct efivars to variable_is_present(), so that we
traverse the correct list.

Reported-by: Michel Lespinasse &lt;walken@google.com&gt;
Tested-by: Michel Lespinasse &lt;walken@google.com&gt;
Cc: Mike Waychison &lt;mikew@google.com&gt;
Cc: Matthew Garrett &lt;matthew.garrett@nebula.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: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Move utf16 functions to kernel core and rename</title>
<updated>2013-04-15T20:23:03Z</updated>
<author>
<name>Matthew Garrett</name>
<email>matthew.garrett@nebula.com</email>
</author>
<published>2013-04-15T20:09:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0635eb8a54cf0fea64b174bb68bc36b9c3d622db'/>
<id>urn:sha1:0635eb8a54cf0fea64b174bb68bc36b9c3d622db</id>
<content type='text'>
We want to be able to use the utf16 functions that are currently present
in the EFI variables code in platform-specific code as well. Move them to
the kernel core, and in the process rename them to accurately describe what
they do - they don't handle UTF16, only UCS2.

Signed-off-by: Matthew Garrett &lt;matthew.garrett@nebula.com&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
<entry>
<title>x86, efivars: firmware bug workarounds should be in platform code</title>
<updated>2013-04-09T10:34:05Z</updated>
<author>
<name>Matt Fleming</name>
<email>matt.fleming@intel.com</email>
</author>
<published>2013-03-25T09:14:30Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a6e4d5a03e9e3587e88aba687d8f225f4f04c792'/>
<id>urn:sha1:a6e4d5a03e9e3587e88aba687d8f225f4f04c792</id>
<content type='text'>
Let's not burden ia64 with checks in the common efivars code that we're not
writing too much data to the variable store. That kind of thing is an x86
firmware bug, plain and simple.

efi_query_variable_store() provides platforms with a wrapper in which they can
perform checks and workarounds for EFI variable storage bugs.

Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Matthew Garrett &lt;mjg59@srcf.ucam.org&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
<entry>
<title>efivars: Fix check for CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE</title>
<updated>2013-03-22T20:08:01Z</updated>
<author>
<name>Ben Hutchings</name>
<email>ben@decadent.org.uk</email>
</author>
<published>2013-03-22T19:56:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ca0ba26fbbd2d81c43085df49ce0abfe34535a90'/>
<id>urn:sha1:ca0ba26fbbd2d81c43085df49ce0abfe34535a90</id>
<content type='text'>
The 'CONFIG_' prefix is not implicit in IS_ENABLED().

Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Cc: Seth Forshee &lt;seth.forshee@canonical.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
<entry>
<title>efivars: Handle duplicate names from get_next_variable()</title>
<updated>2013-03-21T12:43:46Z</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=e971318bbed610e28bb3fde9d548e6aaf0a6b02e'/>
<id>urn:sha1:e971318bbed610e28bb3fde9d548e6aaf0a6b02e</id>
<content type='text'>
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.

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;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
<entry>
<title>efivars: explicitly calculate length of VariableName</title>
<updated>2013-03-21T12:43:46Z</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=ec50bd32f1672d38ddce10fb1841cbfda89cfe9a'/>
<id>urn:sha1:ec50bd32f1672d38ddce10fb1841cbfda89cfe9a</id>
<content type='text'>
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.

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;
</content>
</entry>
<entry>
<title>efivars: Add module parameter to disable use as a pstore backend</title>
<updated>2013-03-21T12:43:46Z</updated>
<author>
<name>Seth Forshee</name>
<email>seth.forshee@canonical.com</email>
</author>
<published>2013-03-11T21:17:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ec0971ba5372a4dfa753f232449d23a8fd98490e'/>
<id>urn:sha1:ec0971ba5372a4dfa753f232449d23a8fd98490e</id>
<content type='text'>
We know that with some firmware implementations writing too much data to
UEFI variables can lead to bricking machines. Recent changes attempt to
address this issue, but for some it may still be prudent to avoid
writing large amounts of data until the solution has been proven on a
wide variety of hardware.

Crash dumps or other data from pstore can potentially be a large data
source. Add a pstore_module parameter to efivars to allow disabling its
use as a backend for pstore. Also add a config option,
CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE, to allow setting the default
value of this paramter to true (i.e. disabled by default).

Signed-off-by: Seth Forshee &lt;seth.forshee@canonical.com&gt;
Cc: Josh Boyer &lt;jwboyer@redhat.com&gt;
Cc: Matthew Garrett &lt;mjg59@srcf.ucam.org&gt;
Cc: Seiji Aguchi &lt;seiji.aguchi@hds.com&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
<entry>
<title>efivars: Allow disabling use as a pstore backend</title>
<updated>2013-03-21T12:43:46Z</updated>
<author>
<name>Seth Forshee</name>
<email>seth.forshee@canonical.com</email>
</author>
<published>2013-03-07T17:40:17Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ed9dc8ce7a1c8115dba9483a9b51df8b63a2e0ef'/>
<id>urn:sha1:ed9dc8ce7a1c8115dba9483a9b51df8b63a2e0ef</id>
<content type='text'>
Add a new option, CONFIG_EFI_VARS_PSTORE, which can be set to N to
avoid using efivars as a backend to pstore, as some users may want to
compile out the code completely.

Set the default to Y to maintain backwards compatability, since this
feature has always been enabled until now.

Signed-off-by: Seth Forshee &lt;seth.forshee@canonical.com&gt;
Cc: Josh Boyer &lt;jwboyer@redhat.com&gt;
Cc: Matthew Garrett &lt;mjg59@srcf.ucam.org&gt;
Cc: Seiji Aguchi &lt;seiji.aguchi@hds.com&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace</title>
<updated>2013-03-10T00:51:13Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-03-10T00:51:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=72932611b4b05bbd89fafa369d564ac8e449809b'/>
<id>urn:sha1:72932611b4b05bbd89fafa369d564ac8e449809b</id>
<content type='text'>
Pull namespace bugfixes from Eric Biederman:
 "This is three simple fixes against 3.9-rc1.  I have tested each of
  these fixes and verified they work correctly.

  The userns oops in key_change_session_keyring and the BUG_ON triggered
  by proc_ns_follow_link were found by Dave Jones.

  I am including the enhancement for mount to only trigger requests of
  filesystem modules here instead of delaying this for the 3.10 merge
  window because it is both trivial and the kind of change that tends to
  bit-rot if left untouched for two months."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
  proc: Use nd_jump_link in proc_ns_follow_link
  fs: Limit sys_mount to only request filesystem modules (Part 2).
  fs: Limit sys_mount to only request filesystem modules.
  userns: Stop oopsing in key_change_session_keyring
</content>
</entry>
<entry>
<title>dmi_scan: fix missing check for _DMI_ signature in smbios_present()</title>
<updated>2013-03-08T23:05:34Z</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=a40e7cf8f06b4e322ba902e4e9f6a6b0c2daa907'/>
<id>urn:sha1:a40e7cf8f06b4e322ba902e4e9f6a6b0c2daa907</id>
<content type='text'>
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;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
