Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755244AbbIADz4 (ORCPT ); Mon, 31 Aug 2015 23:55:56 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]:35056 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751737AbbIADzz (ORCPT ); Mon, 31 Aug 2015 23:55:55 -0400 MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 31 Aug 2015 23:55:54 -0400 Message-ID: Subject: Re: Why is irq_stack_union a union? From: Brian Gerst To: Andy Lutomirski Cc: "linux-kernel@vger.kernel.org" , X86 ML , Steven Rostedt , Andi Kleen 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: 1088 Lines: 23 On Mon, Aug 31, 2015 at 6:01 PM, Andy Lutomirski wrote: > On Mon, Aug 31, 2015 at 2:47 PM, Brian Gerst wrote: >> On Mon, Aug 31, 2015 at 5:00 PM, Andy Lutomirski wrote: >>> Why not just a struct? Also, why is this all tangled up in gsbase initialization? >> >> It has to do with the fact that the GCC stackprotector is hardcoded to >> look for the canary at %gs:40. Since we also use %gs for the percpu >> segment, we have to make sure that the canary is placed at the start >> of the percpu section. Overlaying it onto the bottom of the IRQ stack >> and was the most convenient way to do it, with a side benefit that >> overflowing the stack will trip the canary. > > Would a struct not make more sense, then? Why would it? A union shows the overlay better. -- Brian Gerst -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/