From patchwork Thu Apr 12 13:21:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 897663 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-476269-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=intel.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="lebMc9hR"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40MM5W18CNz9s2R for ; Thu, 12 Apr 2018 23:22:22 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; q=dns; s=default; b=grdP0wWiBvfOU5CcC5UHm5ICua8T2 cMOe3OWH+vnVCglMk2eZLSm3lrFBMZZZketgSGg1K5Tg1HLvO6N8XWfKLJff/9Wo dPHwVaNjwje7DLsJH8Nk76cPc0BJiTYjRkBGUkCjw9Ngqe4dUEE8bNxoIpnFrlgJ sCBZDID5cPE/mE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; s=default; bh=kvOlLUHjk2KXBPCk+BaIFmhq5ms=; b=leb Mc9hRozUgmusP1pJ5m3hFE+MhYz/emDn216OT+AXwYt0ZVJbxR1Mp1WdQqBoZ0e4 ZTuJLbZ46RdGNhiVYmw/vURrWMpGA8WTmPibfp26T+gGfjlMtWJRS6Aq12YR7HGp LnnQc1Murq0bOtoofAiGnPNG6VBgR06pNBsggrG8= Received: (qmail 116837 invoked by alias); 12 Apr 2018 13:22:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 116711 invoked by uid 89); 12 Apr 2018 13:22:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, NO_DNS_FOR_FROM autolearn=ham version=3.3.2 spammy= X-HELO: mga12.intel.com Received: from mga12.intel.com (HELO mga12.intel.com) (192.55.52.136) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Apr 2018 13:22:10 +0000 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2018 06:21:44 -0700 X-ExtLoop1: 1 Received: from gnu-skx-1.sc.intel.com ([172.25.70.206]) by fmsmga007.fm.intel.com with ESMTP; 12 Apr 2018 06:21:44 -0700 Received: by gnu-skx-1.sc.intel.com (Postfix, from userid 1000) id 0881AE0086; Thu, 12 Apr 2018 06:21:44 -0700 (PDT) Date: Thu, 12 Apr 2018 06:21:43 -0700 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Cc: Uros Bizjak Subject: [PATCH] libgcc/CET: Add _CET_ENDBR to __stack_split_initialize Message-ID: <20180412132143.GA224338@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.2 (2017-12-15) Program received signal SIGSEGV, Segmentation fault. __stack_split_initialize () at /export/gnu/import/git/sources/gcc/libgcc/config/i386/morestack.S:751 751 leaq -16000(%rsp),%rax # We should have at least 16K. Missing separate debuginfos, use: dnf debuginfo-install libgcc-8.0.1-0.21.0.fc28.x86_64 (gdb) disass Dump of assembler code for function __stack_split_initialize: => 0x0000000000402858 <+0>: lea -0x3e80(%rsp),%rax 0x0000000000402860 <+8>: mov %rax,%fs:0x70 0x0000000000402869 <+17>: sub $0x8,%rsp 0x000000000040286d <+21>: mov %rsp,%rdi 0x0000000000402870 <+24>: mov $0x3e80,%esi 0x0000000000402875 <+29>: callq 0x401810 <__generic_morestack_set_initial_sp> 0x000000000040287a <+34>: add $0x8,%rsp 0x000000000040287e <+38>: retq End of assembler dump. (gdb) This patch adds the missing ENDBR to __stack_split_initialize. OK for trunk? H.J. --- PR libgcc/85379 * config/i386/morestack.S (__stack_split_initialize): Add _CET_ENDBR. --- libgcc/config/i386/morestack.S | 1 + 1 file changed, 1 insertion(+) diff --git a/libgcc/config/i386/morestack.S b/libgcc/config/i386/morestack.S index eca441a2867..99e65eaaff4 100644 --- a/libgcc/config/i386/morestack.S +++ b/libgcc/config/i386/morestack.S @@ -730,6 +730,7 @@ __morestack_large_model: #endif __stack_split_initialize: + _CET_ENDBR #ifndef __x86_64__