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: <20150130182805.GA20075@redhat.com>
Date:	Fri, 30 Jan 2015 19:28:05 +0100
From:	Oleg Nesterov <oleg@...hat.com>
To:	Dave Hansen <dave@...1.net>
Cc:	dave.hansen@...ux.intel.com, riel@...hat.com, sbsiddha@...il.com,
	luto@...capital.net, tglx@...utronix.de, mingo@...hat.com,
	hpa@...or.com, fenghua.yu@...el.com, x86@...nel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH 1/2] x86, fpu: wrap get_xsave_addr() to make it
	safer

On 01/30, Dave Hansen wrote:
>
> +void *tsk_get_xsave_field(struct task_struct *tsk, int xsave_field)
> +{
> +	union thread_xstate *xstate;
> +
> +	unlazy_fpu(tsk);

ack, but to remind this depends on 2/3 I sent.

> +	xstate = tsk->thread.fpu.state;
> +	/*
> +	 * This might be unallocated if the FPU
> +	 * was never in use.
> +	 */
> +	if (!xstate)
> +		return NULL;

This is cosmetic, unlazy_fpu() is safe if !xstate, __thread_has_fpu()
is not possible in this case.

But perhaps

	if (!used_math())
		return NULL;

will look better.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ