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, 17 Mar 2015 16:09:04 +0100
From:	Denys Vlasenko <dvlasenk@...hat.com>
To:	Ingo Molnar <mingo@...nel.org>
CC:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Borislav Petkov <bp@...en8.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andy Lutomirski <luto@...capital.net>,
	Oleg Nesterov <oleg@...hat.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Alexei Starovoitov <ast@...mgrid.com>,
	Will Drewry <wad@...omium.org>,
	Kees Cook <keescook@...omium.org>, x86@...nel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2 v2] x86/asm/entry/64: Enable interrupts *after* we
 fetch PER_CPU_VAR(old_rsp)

On 03/17/2015 03:36 PM, Ingo Molnar wrote:
> 
> * Denys Vlasenko <dvlasenk@...hat.com> wrote:
> 
>> Without this change, it is still not possible to get rid of
>> PER_CPU_VAR(old_rsp) usage in switch_to: if preemption happens
>> while we did not fetch PER_CPU_VAR(old_rsp) and stored it in pt_regs->sp,
>> PER_CPU_VAR(old_rsp) gets corrupted by other task's user sp.
> 
> Well, wouldn't this be a much clearer explanation:
> 
> "We want to use PER_CPU_VAR(old_rsp) as a simple temporary register, 
>  to shuffle user-space RSP into (and from) when we set up the system 
>  call stack frame. At that point we cannot shuffle values into general 
>  purpose registers, because we have not saved them yet.
> 
>  To be able to do this shuffling into a memory location, we must be 
>  atomic and must not be preempted while we do the shuffling, otherwise 
>  the 'temporary' register gets overwritten by some other task's 
>  temporary register contents ..."
> 
> Agreed?


Sounds good to me.
--
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