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]
Message-ID: <20171019224654.GC1097@fury>
Date:   Thu, 19 Oct 2017 15:46:54 -0700
From:   Darren Hart <dvhart@...radead.org>
To:     Mario.Limonciello@...l.com
Cc:     pali.rohar@...il.com, andy.shevchenko@...il.com,
        linux-kernel@...r.kernel.org, platform-driver-x86@...r.kernel.org,
        luto@...nel.org, quasisec@...gle.com, rjw@...ysocki.net,
        mjg59@...gle.com, hch@....de, greg@...ah.com,
        gnomes@...rguk.ukuu.org.uk
Subject: Re: [PATCH v10 11/15] platform/x86: dell-smbios-smm: test for WSMT

On Thu, Oct 19, 2017 at 06:12:09PM +0000, Mario.Limonciello@...l.com wrote:
> > -----Original Message-----
> > From: Pali Rohár [mailto:pali.rohar@...il.com]
> > Sent: Thursday, October 19, 2017 1:09 PM
> > To: Limonciello, Mario <Mario_Limonciello@...l.com>
> > Cc: dvhart@...radead.org; Andy Shevchenko <andy.shevchenko@...il.com>;
> > LKML <linux-kernel@...r.kernel.org>; platform-driver-x86@...r.kernel.org; Andy
> > Lutomirski <luto@...nel.org>; quasisec@...gle.com; rjw@...ysocki.net;
> > mjg59@...gle.com; hch@....de; Greg KH <greg@...ah.com>; Alan Cox
> > <gnomes@...rguk.ukuu.org.uk>
> > Subject: Re: [PATCH v10 11/15] platform/x86: dell-smbios-smm: test for WSMT
> > 
> > On Thursday 19 October 2017 12:50:14 Mario Limonciello wrote:
> > > +/* When enabled this indicates that SMM won't work */
> > > +static bool test_wsmt_enabled(void)
> > > +{
> > > +	struct calling_interface_token *token;
> > > +
> > > +	/* if token doesn't exist, SMM will work */
> > > +	token = dell_smbios_find_token(WSMT_EN_TOKEN);
> > > +	if (!token)
> > > +		return false;
> > > +
> > > +	/* if token exists, try to access over SMM */
> > > +	buffer->class = CLASS_TOKEN_READ;
> > > +	buffer->select = SELECT_TOKEN_STD;
> > > +	memset(buffer, 0, sizeof(struct calling_interface_buffer));
> > > +	buffer->input[0] = token->location;
> > > +	dell_smbios_smm_call(buffer);
> > > +
> > > +	/* if lookup failed, we know WSMT was enabled */
> > > +	if (buffer->output[0] != 0)
> > > +		return true;
> > > +
> > > +	/* query token status if it didn't fail */
> > > +	return (buffer->output[1] == token->value);
> > > +}
> > > +
> > >  static int __init dell_smbios_smm_init(void)
> > >  {
> > >  	int ret;
> > > @@ -115,6 +140,13 @@ static int __init dell_smbios_smm_init(void)
> > >
> > >  	dmi_walk(find_cmd_address, NULL);
> > >
> > > +	ret = test_wsmt_enabled();
> > 
> > ret is int, but test_wsmt_enabled() returns bool.
> 
> Yes, ret is re-used within this method.
> 0, 1 enum is a subset of int, so this seemed like a logical thing to me to do.

Agreed, the conversion is automatic and he tests for it and returns an
appropriate error code. I don't see a real problem with this.

-- 
Darren Hart
VMware Open Source Technology Center

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ