From patchwork Sat Sep 28 16:23:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 2958041 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2A1719F244 for ; Sat, 28 Sep 2013 16:25:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C0F42035F for ; Sat, 28 Sep 2013 16:25:44 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 77046202D1 for ; Sat, 28 Sep 2013 16:25:43 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VPxJk-0007ME-U7; Sat, 28 Sep 2013 16:24:29 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VPxJO-0005O4-UH; Sat, 28 Sep 2013 16:24:06 +0000 Received: from mail-qe0-f46.google.com ([209.85.128.46]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VPxIr-0005JM-Nq for linux-arm-kernel@lists.infradead.org; Sat, 28 Sep 2013 16:23:36 +0000 Received: by mail-qe0-f46.google.com with SMTP id x7so2665750qeu.19 for ; Sat, 28 Sep 2013 09:23:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dGGSouwYTuO9MC+MPvCwAYQ3plWjVpEkscovmygY21w=; b=SGI/KXlcMiEIdbQnUPFa+fNY+nN/Xx8H4CQSLBkwg7oyjAj+7FMEF5DeQV/lukwl6V jm45MUf+x1yK/O05KInQLeQzJEvSlVHO8AjNwbzxWi3/BOV3PjA4UMztLjRM1YtHcyWH Hvb5FJIkUaiyomTNhaU5IV805fCtp0RxDQ6wHS2Qu4gUn6410r6T9AI5ZH76/dQP0gC/ jUN0LMDhq5b+uk/YIcWis6P71RZOXnAkrjqaRINAo28Rlw6DtNrLsNGWbLhysXw/I3xM uGtLuzLIU0uYtom+0Ko9T4DGhFcOTWHxxKOzcsdzRUPgqAqCZXvlAkFgavXmdbV1bY4I /scw== X-Gm-Message-State: ALoCoQlXKknREGshvpubywkwVReH9U5Fz9ic1yYqQEHo+5NeaI/gwd95vd2d+eB+KbGJdoQz6Z7G X-Received: by 10.49.18.195 with SMTP id y3mr16903465qed.39.1380385391681; Sat, 28 Sep 2013 09:23:11 -0700 (PDT) Received: from rfranz-t520.caveonetworks.com (static-108-20-23-67.bstnma.fios.verizon.net. [108.20.23.67]) by mx.google.com with ESMTPSA id l2sm31145506qad.10.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 28 Sep 2013 09:23:11 -0700 (PDT) From: Roy Franz To: linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, matt.fleming@intel.com, linux@arm.linux.org.uk Subject: [PATCH 5/6] Disable stack protection for decompressor/stub Date: Sat, 28 Sep 2013 09:23:22 -0700 Message-Id: <1380385403-31904-6-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1380385403-31904-1-git-send-email-roy.franz@linaro.org> References: <1380385403-31904-1-git-send-email-roy.franz@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130928_122333_881204_4ACA3C3A X-CRM114-Status: GOOD ( 10.78 ) X-Spam-Score: -2.6 (--) Cc: grant.likely@linaro.org, Roy Franz , dave.martin@arm.com, leif.lindholm@linaro.org, msalter@redhat.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The ARM decompressor/EFI stub do not implement the functions (__stack_chk_guard_setup, etc) that are required for support of stack protection. The actual enablement of stack protection is controlled by heuristics in GCC, which the code added for the EFI stub triggers when CONFIG_STACKPROTECTOR is set. Even with CONFIG_STACKPROTECTOR set, the decompressor was not compiled with stack protection actually enabled. Adding -fno-stack-protector to the decompressor/stub build keeps it building without stack protection as it has always been built. The x86 decompressor/stub is also build with -fno-stack-protector. Signed-off-by: Roy Franz --- arch/arm/boot/compressed/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 5fad8bd..551dbf9 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -136,7 +136,7 @@ ORIG_CFLAGS := $(KBUILD_CFLAGS) KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) endif -ccflags-y := -fpic -mno-single-pic-base -fno-builtin -I$(obj) +ccflags-y := -fpic -mno-single-pic-base -fno-builtin -fno-stack-protector -I$(obj) asflags-y := -DZIMAGE # Supply kernel BSS size to the decompressor via a linker symbol.