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: <20150225094550.GB6676@gmail.com>
Date:	Wed, 25 Feb 2015 10:45:50 +0100
From:	Ingo Molnar <mingo@...nel.org>
To:	Andy Lutomirski <luto@...capital.net>
Cc:	Denys Vlasenko <dvlasenk@...hat.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Borislav Petkov <bp@...en8.de>,
	"H. Peter Anvin" <hpa@...or.com>, 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 ML <x86@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/4] x86: get rid of KERNEL_STACK_OFFSET


* Andy Lutomirski <luto@...capital.net> wrote:

> -       BUG_ON(((current_stack_pointer() ^ this_cpu_read_stable(kernel_stack))
> +       BUG_ON(((current_stack_pointer() ^
> +                (this_cpu_read_stable(kernel_stack) - 1))
>                 & ~(THREAD_SIZE - 1)) != 0);
> 
>         preempt_count_sub(HARDIRQ_OFFSET);
> 
> I added that in and applied this patch.

So this is not just slightly buggy, it's fundamentally 
wrong as well as it removes the possibility of an RSP value 
optimization from the 64-bit path, see my previous mail.

The right solution would be to make SAVE_ARGS recognize 
when KERNEL_STACK_OFFSET == args-offset and omit the RSP 
fixup in that case, or to simply use a __SAVE_ARGS for the 
64-bit path, knowing that RSP has the right value already.

Please also add comments that explain the relationship 
between percpu::kernel_stack, KERNEL_STACK_OFFSET and the 
64-bit system call entry code.

Also, guys, please slow down a bit and be more careful. 
Andy, could you please send me all currently pending entry 
bits pending in your tree, because all the in-flight 
changes make it hard for me to review patches? Please 
(re-)send all patches as well as part of the submission.

Thanks,

	Ingo
--
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