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:   Tue, 10 Oct 2017 18:01:04 +0200
From:   Pali Rohár <pali.rohar@...il.com>
To:     Mario Limonciello <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>
Subject: Re: [PATCH v6 09/14] platform/x86: dell-smbios: Introduce dispatcher
 for SMM calls

On Monday 09 October 2017 17:51:47 Mario Limonciello wrote:
>  static void dell_rfkill_query(struct rfkill *rfkill, void *data)
>  {
> -	struct calling_interface_buffer *buffer;
>  	int radio = ((unsigned long)data & 0xF);
>  	int hwswitch;
>  	int status;
>  	int ret;
>  
> -	buffer = dell_smbios_get_buffer();
> -
> -	dell_smbios_send_request(17, 11);
> -	ret = buffer->output[0];
> +	ret = dell_send_request(17, 11, 0, 0, 0, 0);

Basically I do not like function which takes ten numeric parameters.
Before in this code there was just function with 2 parameters, now there
are lot of zero parameters, without information what which parameter
means...

> diff --git a/drivers/platform/x86/dell-smbios.c b/drivers/platform/x86/dell-smbios.c
> index ade248646578..386130811a34 100644
> --- a/drivers/platform/x86/dell-smbios.c
> +++ b/drivers/platform/x86/dell-smbios.c
> +void dell_smbios_get_smm_address(int *address, int *code)
> +{
> +	*address = da_command_address;
> +	*code = da_command_code;
> +}
> +EXPORT_SYMBOL_GPL(dell_smbios_get_smm_address);

Should not be this function in dell-smbios-smm driver instead of the
dispatcher? It has in name "smm" and also is specific for smm driver...

> diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
> index 90d7e8e55e9b..b74f48d17116 100644
> --- a/drivers/platform/x86/dell-wmi.c
> +++ b/drivers/platform/x86/dell-wmi.c
> @@ -641,13 +641,16 @@ static int dell_wmi_events_set_enabled(bool enable)
>  	struct calling_interface_buffer *buffer;
>  	int ret;
>  
> -	buffer = dell_smbios_get_buffer();
> +	buffer = (void *)get_zeroed_page(GFP_KERNEL);

It is still needed to ask for page? Is not enough to allocate memory via
some *alloc function?

> +	buffer->class = 17;
> +	buffer->select = 3;
>  	buffer->input[0] = 0x10000;
>  	buffer->input[1] = 0x51534554;
>  	buffer->input[3] = enable;
> -	dell_smbios_send_request(17, 3);
> -	ret = buffer->output[0];
> -	dell_smbios_release_buffer();
> +	ret = dell_smbios_call(buffer);
> +	if (ret == 0)
> +		ret = buffer->output[0];
> +	free_page((unsigned long)buffer);
>  
>  	return dell_smbios_error(ret);
>  }

-- 
Pali Rohár
pali.rohar@...il.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ