From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759583AbdJQTKo (ORCPT ); Tue, 17 Oct 2017 15:10:44 -0400 Received: from esa5.dell-outbound.iphmx.com ([68.232.153.95]:28301 "EHLO esa5.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753816AbdJQTKn (ORCPT ); Tue, 17 Oct 2017 15:10:43 -0400 From: X-LoopCount0: from 10.166.132.172 X-IronPort-AV: E=Sophos;i="5.43,391,1503378000"; d="scan'208";a="75017493" X-DLP: DLP_GlobalPCIDSS To: CC: , , , , , , , , , , Subject: RE: [PATCH v9 07/17] platform/x86: dell-smbios: only run if proper oem string is detected Thread-Topic: [PATCH v9 07/17] platform/x86: dell-smbios: only run if proper oem string is detected Thread-Index: AQHTR3qppEa1HEoPRkinzdNMAVDS/qLoZ1CA Date: Tue, 17 Oct 2017 19:10:40 +0000 Message-ID: References: <255fc4b41a394542d63bf5a958314904e865a273.1508259916.git.mario.limonciello@dell.com> <20171017190336.iqhzmdsimx4f7mfw@pali> In-Reply-To: <20171017190336.iqhzmdsimx4f7mfw@pali> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.143.18.86] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id v9HJAmJU013517 > -----Original Message----- > From: Pali Rohár [mailto:pali.rohar@gmail.com] > Sent: Tuesday, October 17, 2017 2:04 PM > To: Limonciello, Mario > Cc: dvhart@infradead.org; Andy Shevchenko ; > LKML ; platform-driver-x86@vger.kernel.org; Andy > Lutomirski ; quasisec@google.com; rjw@rjwysocki.net; > mjg59@google.com; hch@lst.de; Greg KH ; Alan Cox > > Subject: Re: [PATCH v9 07/17] platform/x86: dell-smbios: only run if proper oem > string is detected > > On Tuesday 17 October 2017 13:21:51 Mario Limonciello wrote: > > The proper way to indicate that a system is a 'supported' Dell System > > is by the presence of this string in OEM strings. > > > > Allowing the driver to load on non-Dell systems will have undefined > > results. > > > > Signed-off-by: Mario Limonciello > > Reviewed-by: Edward O'Callaghan > > --- > > drivers/platform/x86/dell-smbios.c | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/drivers/platform/x86/dell-smbios.c b/drivers/platform/x86/dell- > smbios.c > > index e9b1ca07c872..7e779278d054 100644 > > --- a/drivers/platform/x86/dell-smbios.c > > +++ b/drivers/platform/x86/dell-smbios.c > > @@ -172,8 +172,15 @@ static void __init find_tokens(const struct dmi_header > *dm, void *dummy) > > > > static int __init dell_smbios_init(void) > > { > > + const struct dmi_device *valid; > > int ret; > > > > + valid = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Dell System", > NULL); > > Are you sure that all Dell machines have exactly this string? IIRC this > smbios interface via SMM is supported by machines back to 2005... Also > in other DMI tables in dell-latop there is e.g. "Dell Inc." or "Dell > Computer Corporation". > I checked the spec and it's been there since systems 1999 onward. > > + if (!valid) { > > + pr_err("Unable to run on non-Dell system\n"); > > + return -ENODEV; > > + } > > + > > dmi_walk(find_tokens, NULL); > > > > if (!da_tokens) { > > -- > Pali Rohár > pali.rohar@gmail.com