Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752642AbbHaVrs (ORCPT ); Mon, 31 Aug 2015 17:47:48 -0400 Received: from mail-ob0-f180.google.com ([209.85.214.180]:33432 "EHLO mail-ob0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751521AbbHaVrr (ORCPT ); Mon, 31 Aug 2015 17:47:47 -0400 MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 31 Aug 2015 17:47:46 -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: 815 Lines: 17 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. -- 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/