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:	Wed, 8 May 2013 05:24:58 +0000
From:	Matthew Garrett <matthew.garrett@...ula.com>
To:	Qiaowei Ren <qiaowei.ren@...el.com>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"platform-driver-x86@...r.kernel.org" 
	<platform-driver-x86@...r.kernel.org>,
	Xiaoyan Zhang <xiaoyan.zhang@...el.com>,
	Gang Wei <gang.wei@...el.com>
Subject: Re: [PATCH 4/4] driver: provide sysfs interfaces to access SMX
 parameter

On Tue, 2013-05-07 at 22:55 +0800, Qiaowei Ren wrote:
> These interfaces are located in /sys/devices/platform/intel_txt/parameter/,
> showing specific parameter information for SMX features supported by
> the processor.

Explain what SMX is here.

> +Contact:	"Qiaowei Ren" <qiaowei.ren@...el.com>
> +Description:	The parameter/ directory exposes specific parameter
> +		information for SMX features supported by the processor.

Also here.

> +What:		/sys/devices/platform/intel_txt/parameter/acm_max_size
> +Date:		May 2013
> +KernelVersion:	3.9
> +Contact:	"Qiaowei Ren" <qiaowei.ren@...el.com>
> +Description:	The "acm_max_size" property will show max size of
> +		authenticated code execution area.

What would userspace use this for?

> +What:		/sys/devices/platform/intel_txt/parameter/acm_mem_types
> +Date:		May 2013
> +KernelVersion:	3.9
> +Contact:	"Qiaowei Ren" <qiaowei.ren@...el.com>
> +Description:	The "acm_max_types" property will show external memory
> +		types supported during AC mode.

Or this? And what's AC mode?

> +static void __getsec_parameters(uint32_t index, int *param_type,
> +				uint32_t *peax, uint32_t *pebx,
> +				uint32_t *pecx)
> +{
> +	uint32_t eax = 0, ebx = 0, ecx = 0;

These are all going to be overwritten by the getsec operation? Do they
really need to be initialised?

> +	__asm__ __volatile__ (IA32_GETSEC_OPCODE "\n"
> +			      : "=a"(eax), "=b"(ebx), "=c"(ecx)
> +			      : "a"(IA32_GETSEC_PARAMETERS), "b"(index));
> +
> +	*param_type = eax & 0x1f;
> +	*peax = eax;
> +	*pebx = ebx;
> +	*pecx = ecx;

Should there be a check for failure here? Is it possible for this
operation to fail?

> +	write_cr4(read_cr4() | CR4_SMXE);

Whoo. This needs at least a giant comment and probably some locking, but
if this is supposed to be set during runtime then it should be done in
core architecture code rather than just in this driver.

> +	sscanf(buf, "%d", &index);

What if this fails?

> +EXPORT_SYMBOL_GPL(sysfs_create_parameter);
> +
> +MODULE_LICENSE("GPL");

Not needed.

> +#define IA32_GETSEC_OPCODE	".byte 0x0f,0x37"

Nnf. Does the assembler really not know about this instruction?

-- 
Matthew Garrett | mjg59@...f.ucam.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ