lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 25 Feb 2017 18:23:55 +0100
From:   Hans de Goede <hdegoede@...hat.com>
To:     Adrian Hunter <adrian.hunter@...el.com>,
        Ulf Hansson <ulf.hansson@...aro.org>,
        Jean Delvare <jdelvare@...e.com>
Cc:     Hans de Goede <hdegoede@...hat.com>, Takashi Iwai <tiwai@...e.de>,
        "russianneuromancer @ ya . ru" <russianneuromancer@...ru>,
        linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/3] firmware: dmi_scan: Add dmi_product_name kernel cmdline option

Unfortunately some firmware has all the DMI strings filled with:
"Default String" (or something equally useless). This makes it impossible
to apply DMI based quirks to certain machines.

This commit adds a dmi_product_name kernel cmdline option which can
be used to override the DMI_PRODUCT_NAME string, so that DMI based
quirks can still be used on such boards, there are 3 reasons for this:

1) Rather then add cmdline options for all things which can be DMI quirked
and thus may need to be specified, this only requires adding code for
a single extra cmdline option

2) Some devices can be quite quirky, e.g. the GPD win mini laptop /
clamshell x86 machine, needing several quirks in both kernel and userspace
(udev hwdb) in this case being able to fake a unique dmi product name
allows making these devices usable with a single kernel cmdline option
rather then requiring multiple kernel cmdline options + manual userspace
tweaking

3) In some case we may be able to successfully get the manufacturer to
fix the DMI strings with a firmware update, but not all users may want
to update, this will allow users to use DMI based quirks without forcing
them to update their firmware

Signed-off-by: Hans de Goede <hdegoede@...hat.com>
---
Note the GPD win: http://www.gpd.hk/gpdwin.asp is the main reason I wrote
this patch. I've requested the manufacturer to do a BIOS update fixing the
DMI strings, but I cannot guarantee that that will happen.
---
 drivers/firmware/dmi_scan.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 54be60e..c99e753 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -1047,3 +1047,17 @@ void dmi_memdev_name(u16 handle, const char **bank, const char **device)
 	}
 }
 EXPORT_SYMBOL_GPL(dmi_memdev_name);
+
+static int __init dmi_parse_dmi_product_name(char *str)
+{
+	static char prod_name[32];
+
+	if (!str)
+		return -EINVAL;
+
+	strlcpy(prod_name, str, sizeof(prod_name));
+	dmi_ident[DMI_PRODUCT_NAME] = prod_name;
+
+	return 0;
+}
+early_param("dmi_product_name", dmi_parse_dmi_product_name);
-- 
2.9.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ