|
Message-ID: <CAGXu5jLQfS6gK2MyetWPjyJDOg8NdACXsPXLt7OasQE03VUwPg@mail.gmail.com> Date: Wed, 29 Mar 2017 14:09:15 -0700 From: Kees Cook <keescook@...omium.org> To: "H. Peter Anvin" <hpa@...or.com> Cc: LKML <linux-kernel@...r.kernel.org>, Rik van Riel <riel@...hat.com>, Andy Lutomirski <luto@...nel.org>, Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, "x86@...nel.org" <x86@...nel.org>, Paolo Bonzini <pbonzini@...hat.com>, Radim Krčmář <rkrcmar@...hat.com>, Peter Zijlstra <peterz@...radead.org>, Dave Hansen <dave.hansen@...ux.intel.com>, Yu-cheng Yu <yu-cheng.yu@...el.com>, Masahiro Yamada <yamada.masahiro@...ionext.com>, Borislav Petkov <bp@...e.de>, Christian Borntraeger <borntraeger@...ibm.com>, Thomas Garnier <thgarnie@...gle.com>, Brian Gerst <brgerst@...il.com>, He Chen <he.chen@...ux.intel.com>, Mathias Krause <minipli@...glemail.com>, Fenghua Yu <fenghua.yu@...el.com>, Piotr Luc <piotr.luc@...el.com>, Kyle Huey <me@...ehuey.com>, Len Brown <len.brown@...el.com>, KVM <kvm@...r.kernel.org>, "kernel-hardening@...ts.openwall.com" <kernel-hardening@...ts.openwall.com> Subject: Re: [PATCH] x86/fpu: move FPU state into separate cache On Wed, Mar 29, 2017 at 1:45 PM, H. Peter Anvin <hpa@...or.com> wrote: > On 03/29/17 13:39, Kees Cook wrote: >> This removes ARCH_WANTS_DYNAMIC_TASK_STRUCT from x86, leaving only s390 >> still defining this config. >> >> In order to support future structure layout randomization of the >> task_struct, none of the structure fields are allowed to have a specific >> position or dynamic size. To enable randomization of task_struct on >> x86, the FPU state must be moved to its own dynamically sized cache, >> and dereferenced from the task_struct. >> >> This change is nearly identical to what was done in grsecurity to support >> structure layout randomization. Hopefully I found all the needed changes. >> This passes allyesconfig, and boot tests. > > Is this really what we want to happen? It seems much more sane to > simply make them adjacent; they don't need to be part of the same > structure (in practice, there are three objects: thread_info, > task_struct, and the FPU state.) They're adjacent already, which poses a problem for the struct layout randomization plugin, since adjacency may no longer be true (after layout randomization). This adjacency (or not) isn't really the problem: it's that FPU state size is only known at runtime. Another solution would be to have FPU state be a fixed size... -Kees -- Kees Cook Pixel Security
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.