Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933206AbdC2Vb0 (ORCPT ); Wed, 29 Mar 2017 17:31:26 -0400 Received: from mail-io0-f176.google.com ([209.85.223.176]:36401 "EHLO mail-io0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932679AbdC2VaE (ORCPT ); Wed, 29 Mar 2017 17:30:04 -0400 MIME-Version: 1.0 In-Reply-To: References: <20170329203908.GA39222@beast> From: Linus Torvalds Date: Wed, 29 Mar 2017 14:30:02 -0700 X-Google-Sender-Auth: jQsM_yh1JuNavuBH0rtk-QmAMpU Message-ID: Subject: Re: [PATCH] x86/fpu: move FPU state into separate cache To: Kees Cook Cc: "H. Peter Anvin" , LKML , Rik van Riel , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , "x86@kernel.org" , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Peter Zijlstra , Dave Hansen , Yu-cheng Yu , Masahiro Yamada , Borislav Petkov , Christian Borntraeger , Thomas Garnier , Brian Gerst , He Chen , Mathias Krause , Fenghua Yu , Piotr Luc , Kyle Huey , Len Brown , KVM , "kernel-hardening@lists.openwall.com" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 845 Lines: 24 On Wed, Mar 29, 2017 at 2:09 PM, Kees Cook wrote: > > They're adjacent already, which poses a problem for the struct layout > randomization plugin, since adjacency may no longer be true (after > layout randomization). T What? The layout randomization can't change anything, if you just make the adjacency be done explicitly instead of by having the thing be a fixed member. The trivial model might be to just declare the fpu part as an unsized array at the end: /* Floating point and extended processor state */ struct fpu fpu[]; because there is no way in hell that any randomization code can move those kinds of unsized arrays around. If it does, the gcc plugin is such unbelievable garbage that it would be insane to depend on such shit in the first place. Linus