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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 10 Apr 2015 14:07:35 -0700
From:	Andy Lutomirski <luto@...capital.net>
To:	Andi Kleen <ak@...ux.intel.com>
Cc:	Andi Kleen <andi@...stfloor.org>, X86 ML <x86@...nel.org>,
	Andrew Lutomirski <luto@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Borislav Petkov <bp@...en8.de>
Subject: Re: [PATCH 4/8] x86: Add support for rd/wr fs/gs base

On Fri, Apr 10, 2015 at 1:57 PM, Andi Kleen <ak@...ux.intel.com> wrote:
>> I think all of this stems from unfortunate naming.  DEBUG_STACK isn't
>> one stack -- it's a debug stack *array*.  The IST shift mechanism
>> means that we can use different entries in that array as our stacks
>> depending on how deeply nested we are.
>
> I still think it's a terrible idea.
>
>> > Just handling it in the code is simple enough.
>>
>> It seems to account for over half the asm diff.  I'm talking about the
>> addition of approximately two lines of C and the removal of a huge
>> chunk of the asm diff.
>
> It's just adding offsets to the stack code. Nothing complicated.
> It's also straight forward code. Far more preferable than your magic
> overlapping stacks.

There are no overlapping stacks.  There's an array of stacks.  That
array wasn't my idea.  I want to delete it, and I have WIP code that
prepares to delete it.  But we have it today, and all of the IST
stacks have exactly the same usable size, and we might as well take
advantage of that.

The layout is straightforward if overcomplicated:

--- debug stack + 8k ---
... 4092 bytes free, including pt_regs ...
kernel gs base
--- debug stack + 4k ---
... 4092 bytes free, including pt_regs ...
kernel gs base
--- bottom of debug stack array ---

There are more stacks above or below this (I haven't checked which
order the things are in, and it doesn't matter).

The top debug stack *is not 8k*.  It's 4k, despite the awkward
description in the code that allocates it.

So the IST stacks really are all the same size.

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