From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754607AbbGPCvU (ORCPT ); Wed, 15 Jul 2015 22:51:20 -0400 Received: from mail-ie0-f176.google.com ([209.85.223.176]:34357 "EHLO mail-ie0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753954AbbGPCvS (ORCPT ); Wed, 15 Jul 2015 22:51:18 -0400 MIME-Version: 1.0 In-Reply-To: <55A6FC31.5010102@linux.intel.com> References: <1430848300-27877-1-git-send-email-mingo@kernel.org> <1430848300-27877-19-git-send-email-mingo@kernel.org> <55A56709.6020201@linux.intel.com> <20150715110726.GA26611@gmail.com> <55A6FC31.5010102@linux.intel.com> Date: Wed, 15 Jul 2015 19:51:18 -0700 X-Google-Sender-Auth: 5DhBD97OZTsX76aRYyvmRUSuBIw Message-ID: Subject: Re: [REGRESSION] 4.2-rc2: early boot memory corruption from FPU rework From: Linus Torvalds To: Dave Hansen Cc: Ingo Molnar , Linux Kernel Mailing List , Andy Lutomirski , Borislav Petkov , Fenghua Yu , "H. Peter Anvin" , Oleg Nesterov , Thomas Gleixner , Ross Zwisler Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 15, 2015 at 5:34 PM, Dave Hansen wrote: > > I understand why you were misled by it, but the old "xsave_hdr_struct" > was wrong. Fenghua even posted patches to remove it before the FPU > rework (you were cc'd): > > https://lkml.org/lkml/2015/4/18/164 Oh, and that patch looks like a good idea. I wish there was some way to make sure sizeof() fail on it so that we'd enforce that nobody allocates that thing as-is. I had this dim memory that an unsized array at the end would do that, but I was clearly wrong. It's just the array itself you can't do sizeof on, not the structure that contains it. Is there some magic trick that I'm forgetting? Linus