<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/firmware/dmi_scan.c, branch linux-4.3.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>firmware: dmi_scan: Coding style cleanups</title>
<updated>2015-06-25T07:06:57+00:00</updated>
<author>
<name>Jean Delvare</name>
<email>jdelvare@suse.de</email>
</author>
<published>2015-06-25T07:06:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d1d8704c48f9c2bb791e8e183a41019f35a3f7f0'/>
<id>d1d8704c48f9c2bb791e8e183a41019f35a3f7f0</id>
<content type='text'>
Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firmware: dmi_scan: add SBMIOS entry and DMI tables</title>
<updated>2015-06-25T07:06:56+00:00</updated>
<author>
<name>Ivan Khoronzhuk</name>
<email>ivan.khoronzhuk@globallogic.com</email>
</author>
<published>2015-06-25T07:06:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d7f96f97c4031fa4ffdb7801f9aae23e96170a6f'/>
<id>d7f96f97c4031fa4ffdb7801f9aae23e96170a6f</id>
<content type='text'>
Some utils, like dmidecode and smbios, need to access SMBIOS entry
table area in order to get information like SMBIOS version, size, etc.
Currently it's done via /dev/mem. But for situation when /dev/mem
usage is disabled, the utils have to use dmi sysfs instead, which
doesn't represent SMBIOS entry and adds code/delay redundancy when direct
access for table is needed.

So this patch creates dmi/tables and adds SMBIOS entry point to allow
utils in question to work correctly without /dev/mem. Also patch adds
raw dmi table to simplify dmi table processing in user space, as
proposed by Jean Delvare.

Tested-by: Roy Franz &lt;roy.franz@linaro.org&gt;
Signed-off-by: Ivan Khoronzhuk &lt;ivan.khoronzhuk@globallogic.com&gt;
Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some utils, like dmidecode and smbios, need to access SMBIOS entry
table area in order to get information like SMBIOS version, size, etc.
Currently it's done via /dev/mem. But for situation when /dev/mem
usage is disabled, the utils have to use dmi sysfs instead, which
doesn't represent SMBIOS entry and adds code/delay redundancy when direct
access for table is needed.

So this patch creates dmi/tables and adds SMBIOS entry point to allow
utils in question to work correctly without /dev/mem. Also patch adds
raw dmi table to simplify dmi table processing in user space, as
proposed by Jean Delvare.

Tested-by: Roy Franz &lt;roy.franz@linaro.org&gt;
Signed-off-by: Ivan Khoronzhuk &lt;ivan.khoronzhuk@globallogic.com&gt;
Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firmware: dmi_scan: Trim DMI table length before exporting it</title>
<updated>2015-06-25T07:06:56+00:00</updated>
<author>
<name>Jean Delvare</name>
<email>jdelvare@suse.de</email>
</author>
<published>2015-06-25T07:06:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6e0ad59e3d838a2887e7aa657baee5896030d009'/>
<id>6e0ad59e3d838a2887e7aa657baee5896030d009</id>
<content type='text'>
The SMBIOS v3 entry points specify a maximum length for the DMI table,
not the exact length. Thus there may be garbage after the end-of-table
marker, which we don't want to export to user-space. Adjust dmi_len
when we find the end-of-table marker, so that only the actual table
payload is exported.

Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Cc: Ivan Khoronzhuk &lt;ivan.khoronzhuk@globallogic.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The SMBIOS v3 entry points specify a maximum length for the DMI table,
not the exact length. Thus there may be garbage after the end-of-table
marker, which we don't want to export to user-space. Adjust dmi_len
when we find the end-of-table marker, so that only the actual table
payload is exported.

Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Cc: Ivan Khoronzhuk &lt;ivan.khoronzhuk@globallogic.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firmware: dmi_scan: Rename dmi_table to dmi_decode_table</title>
<updated>2015-06-25T07:06:56+00:00</updated>
<author>
<name>Ivan Khoronzhuk</name>
<email>ivan.khoronzhuk@globallogic.com</email>
</author>
<published>2015-06-25T07:06:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=eb4c5ea50e60aa8faaf6aae762cb06ee1c8e0b8e'/>
<id>eb4c5ea50e60aa8faaf6aae762cb06ee1c8e0b8e</id>
<content type='text'>
The "dmi_table" function looks like data instance, but it does DMI
table decode. This patch renames it to "dmi_decode_table" name as
more appropriate. That allows us to use "dmi_table" name for correct
purposes.

Signed-off-by: Ivan Khoronzhuk &lt;ivan.khoronzhuk@globallogic.com&gt;
Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The "dmi_table" function looks like data instance, but it does DMI
table decode. This patch renames it to "dmi_decode_table" name as
more appropriate. That allows us to use "dmi_table" name for correct
purposes.

Signed-off-by: Ivan Khoronzhuk &lt;ivan.khoronzhuk@globallogic.com&gt;
Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firmware: dmi_scan: Only honor end-of-table for 64-bit tables</title>
<updated>2015-06-25T07:06:55+00:00</updated>
<author>
<name>Jean Delvare</name>
<email>jdelvare@suse.de</email>
</author>
<published>2015-06-25T07:06:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=17cd5bd5391e6e7b363d66335e1bc6760ae969b9'/>
<id>17cd5bd5391e6e7b363d66335e1bc6760ae969b9</id>
<content type='text'>
A 32-bit entry point to a DMI table says how many structures the table
contains. The SMBIOS specification explicitly says that end-of-table
markers should be ignored if they are not actually at the end of the
DMI table. So only honor the end-of-table marker for tables accessed
through 64-bit entry points, as they do not specify a structure count.

Fixes: fc43026278 ("dmi: add support for SMBIOS 3.0 64-bit entry point")
Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Acked-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Cc: Leif Lindholm &lt;leif.lindholm@linaro.org&gt;
Cc: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A 32-bit entry point to a DMI table says how many structures the table
contains. The SMBIOS specification explicitly says that end-of-table
markers should be ignored if they are not actually at the end of the
DMI table. So only honor the end-of-table marker for tables accessed
through 64-bit entry points, as they do not specify a structure count.

Fixes: fc43026278 ("dmi: add support for SMBIOS 3.0 64-bit entry point")
Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Acked-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Cc: Leif Lindholm &lt;leif.lindholm@linaro.org&gt;
Cc: Matt Fleming &lt;matt.fleming@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firmware: dmi_scan: Fix ordering of product_uuid</title>
<updated>2015-05-14T12:40:50+00:00</updated>
<author>
<name>Jean Delvare</name>
<email>jdelvare@suse.de</email>
</author>
<published>2015-05-14T12:40:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5c1ac56b51b9d222ab202dec1ac2f4215346129d'/>
<id>5c1ac56b51b9d222ab202dec1ac2f4215346129d</id>
<content type='text'>
In function dmi_present(), dmi_walk_early() calls dmi_table(), which
calls dmi_decode(), which ultimately calls dmi_save_uuid(). This last
function makes a decision based on the value of global variable
dmi_ver. The problem is that this variable is set right _after_
dmi_walk_early() returns. So dmi_save_uuid() always sees dmi_ver == 0
regardless of the actual version implemented.

This causes /sys/class/dmi/id/product_uuid to always use the old
ordering even on systems implementing DMI/SMBIOS 2.6 or later, which
should use the new ordering.

This is broken since kernel v3.8 for legacy DMI implementations and
since kernel v3.10 for SMBIOS 2 implementations. SMBIOS 3
implementations with the 64-bit entry point are not affected.

The first breakage does not matter much as in practice legacy DMI
implementations are always for versions older than 2.6, which is when
the UUID ordering changed. The second breakage is more problematic as
it affects the vast majority of x86 systems manufactured since 2009.

Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Fixes: 9f9c9cbb6057 ("drivers/firmware/dmi_scan.c: fetch dmi version from SMBIOS if it exists")
Fixes: 79bae42d51a5 ("dmi_scan: refactor dmi_scan_machine(), {smbios,dmi}_present()")
Acked-by: Zhenzhong Duan &lt;zhenzhong.duan@oracle.com&gt;
Cc: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Cc: Artem Savkov &lt;artem.savkov@gmail.com&gt;
Cc: Ivan Khoronzhuk &lt;ivan.khoronzhuk@linaro.org&gt;
Cc: Matt Fleming &lt;matt.fleming@intel.com&gt;
Cc: stable@vger.kernel.org [v3.10+]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In function dmi_present(), dmi_walk_early() calls dmi_table(), which
calls dmi_decode(), which ultimately calls dmi_save_uuid(). This last
function makes a decision based on the value of global variable
dmi_ver. The problem is that this variable is set right _after_
dmi_walk_early() returns. So dmi_save_uuid() always sees dmi_ver == 0
regardless of the actual version implemented.

This causes /sys/class/dmi/id/product_uuid to always use the old
ordering even on systems implementing DMI/SMBIOS 2.6 or later, which
should use the new ordering.

This is broken since kernel v3.8 for legacy DMI implementations and
since kernel v3.10 for SMBIOS 2 implementations. SMBIOS 3
implementations with the 64-bit entry point are not affected.

The first breakage does not matter much as in practice legacy DMI
implementations are always for versions older than 2.6, which is when
the UUID ordering changed. The second breakage is more problematic as
it affects the vast majority of x86 systems manufactured since 2009.

Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Fixes: 9f9c9cbb6057 ("drivers/firmware/dmi_scan.c: fetch dmi version from SMBIOS if it exists")
Fixes: 79bae42d51a5 ("dmi_scan: refactor dmi_scan_machine(), {smbios,dmi}_present()")
Acked-by: Zhenzhong Duan &lt;zhenzhong.duan@oracle.com&gt;
Cc: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Cc: Artem Savkov &lt;artem.savkov@gmail.com&gt;
Cc: Ivan Khoronzhuk &lt;ivan.khoronzhuk@linaro.org&gt;
Cc: Matt Fleming &lt;matt.fleming@intel.com&gt;
Cc: stable@vger.kernel.org [v3.10+]
</pre>
</div>
</content>
</entry>
<entry>
<title>firmware: dmi_scan: Simplified displayed version</title>
<updated>2015-05-14T12:40:50+00:00</updated>
<author>
<name>Jean Delvare</name>
<email>jdelvare@suse.de</email>
</author>
<published>2015-05-14T12:40:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c24930457d4b06903aa5dada50e04a83513e3b6b'/>
<id>c24930457d4b06903aa5dada50e04a83513e3b6b</id>
<content type='text'>
The trailing .x adds no information for the reader, and if anyone
tries to parse that line, this is more work as they have 3 different
formats to handle instead of 2. Plus, this makes backporting fixes
harder.

Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Fixes: 95be58df74a5 ("firmware: dmi_scan: Use full dmi version for SMBIOS3")
Cc: Ivan Khoronzhuk &lt;ivan.khoronzhuk@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The trailing .x adds no information for the reader, and if anyone
tries to parse that line, this is more work as they have 3 different
formats to handle instead of 2. Plus, this makes backporting fixes
harder.

Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Fixes: 95be58df74a5 ("firmware: dmi_scan: Use full dmi version for SMBIOS3")
Cc: Ivan Khoronzhuk &lt;ivan.khoronzhuk@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'core-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2015-04-13T17:22:30+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2015-04-13T17:22:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9c65e12a55fea2da50f4069ec0dc47c50b7bd2bb'/>
<id>9c65e12a55fea2da50f4069ec0dc47c50b7bd2bb</id>
<content type='text'>
Pull EFI update from Ingo Molnar:
 "This tree includes various fixes, cleanups, a new efi=debug boot
  option and EFI boot stub memory allocation optimizations"

* 'core-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  efi/libstub: Retrieve FDT size when loaded from UEFI config table
  efi: Clean up the efi_call_phys_[prolog|epilog]() save/restore interaction
  efi: Disable interrupts around EFI calls, not in the epilog/prolog calls
  x86/efi: Add a "debug" option to the efi= cmdline
  firmware: dmi_scan: Use direct access to static vars
  firmware: dmi_scan: Use full dmi version for SMBIOS3
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull EFI update from Ingo Molnar:
 "This tree includes various fixes, cleanups, a new efi=debug boot
  option and EFI boot stub memory allocation optimizations"

* 'core-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  efi/libstub: Retrieve FDT size when loaded from UEFI config table
  efi: Clean up the efi_call_phys_[prolog|epilog]() save/restore interaction
  efi: Disable interrupts around EFI calls, not in the epilog/prolog calls
  x86/efi: Add a "debug" option to the efi= cmdline
  firmware: dmi_scan: Use direct access to static vars
  firmware: dmi_scan: Use full dmi version for SMBIOS3
</pre>
</div>
</content>
</entry>
<entry>
<title>firmware: dmi_scan: Prevent dmi_num integer overflow</title>
<updated>2015-03-27T10:53:46+00:00</updated>
<author>
<name>Jean Delvare</name>
<email>jdelvare@suse.de</email>
</author>
<published>2015-03-20T08:59:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=bfbaafae8519d82d10da6abe75f5766dd5b20475'/>
<id>bfbaafae8519d82d10da6abe75f5766dd5b20475</id>
<content type='text'>
dmi_num is a u16, dmi_len is a u32, so this construct:

	dmi_num = dmi_len / 4;

would result in an integer overflow for a DMI table larger than
256 kB. I've never see such a large table so far, but SMBIOS 3.0
makes it possible so maybe we'll see such tables in the future.

So instead of faking a structure count when the entry point does
not provide it, adjust the loop condition in dmi_table() to properly
deal with the case where dmi_num is not set.

This bug was introduced with the initial SMBIOS 3.0 support in commit
fc43026278b2 ("dmi: add support for SMBIOS 3.0 64-bit entry point").

Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Cc: Matt Fleming &lt;matt.fleming@intel.com&gt;
Cc: Ivan Khoronzhuk &lt;ivan.khoronzhuk@linaro.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Acked-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dmi_num is a u16, dmi_len is a u32, so this construct:

	dmi_num = dmi_len / 4;

would result in an integer overflow for a DMI table larger than
256 kB. I've never see such a large table so far, but SMBIOS 3.0
makes it possible so maybe we'll see such tables in the future.

So instead of faking a structure count when the entry point does
not provide it, adjust the loop condition in dmi_table() to properly
deal with the case where dmi_num is not set.

This bug was introduced with the initial SMBIOS 3.0 support in commit
fc43026278b2 ("dmi: add support for SMBIOS 3.0 64-bit entry point").

Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Cc: Matt Fleming &lt;matt.fleming@intel.com&gt;
Cc: Ivan Khoronzhuk &lt;ivan.khoronzhuk@linaro.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Acked-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firmware: dmi_scan: Use direct access to static vars</title>
<updated>2015-03-26T14:00:15+00:00</updated>
<author>
<name>Ivan Khoronzhuk</name>
<email>ivan.khoronzhuk@linaro.org</email>
</author>
<published>2015-02-18T11:33:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=552e19d8764aeea3ecdf6cf29e22d6b99a505091'/>
<id>552e19d8764aeea3ecdf6cf29e22d6b99a505091</id>
<content type='text'>
There is no reason to pass static vars to function that can use
only them.

The dmi_table() can use only dmi_len and dmi_num static vars, so use
them directly. In this case we can freely change their type in one
place and slightly decrease redundancy.

Signed-off-by: Ivan Khoronzhuk &lt;ivan.khoronzhuk@linaro.org&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is no reason to pass static vars to function that can use
only them.

The dmi_table() can use only dmi_len and dmi_num static vars, so use
them directly. In this case we can freely change their type in one
place and slightly decrease redundancy.

Signed-off-by: Ivan Khoronzhuk &lt;ivan.khoronzhuk@linaro.org&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
