From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61957 invoked by alias); 21 Jun 2017 15:25:43 -0000 Mailing-List: contact gnu-gabi-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: gnu-gabi-owner@sourceware.org Received: (qmail 61628 invoked by uid 89); 21 Jun 2017 15:25:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-8.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2356, pts, technology X-Spam-Status: No, score=-8.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mail-oi0-f46.google.com Received: from mail-oi0-f46.google.com (HELO mail-oi0-f46.google.com) (209.85.218.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 Jun 2017 15:25:39 +0000 Received: by mail-oi0-f46.google.com with SMTP id p66so59356107oia.0 for ; Wed, 21 Jun 2017 08:25:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=jST86A+aONW9cgfrcTVuMOuq2+H+RxI0Cq7y/W/w88g=; b=C2qMRJwW+6yE4cf+rF54upaLjWVINM04mBShrFi2SUrc34IWkvRKdh6br8Zq0OTp3m 5zKfsGOMJZoH/EQFfMgSOzHG8C9nRMcDlQxZbrUfpqDMaHbCwR5SCTp4xyoSHuOZdO70 kKfEcHdUelCjLg5yJLbWgjaPqjMBdaTq3d1OUufMTTXJMM2FwDm+Y5TZNwGwCT4iu5QB 9c0I6b6tBhLbm4wtV2N9yEMbp/o/mqp7NqodeURCZSX0VZpo9C5fITEfv8yV6YKTlQhJ 6A7aA+w+XHObsQyQ2PBG6je77Wwq/3Rb77mcVND0m75g7QXbXPV2nbRfppj+Rgpkp7+C 9nmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=jST86A+aONW9cgfrcTVuMOuq2+H+RxI0Cq7y/W/w88g=; b=WrD+MIBPBKNTbZ0Ouqza8APRxgt5eaZW3RLNR3N5C4qeXeVWGCfinMdRgBCQ/fl9/J UNcnhSdlIGSExRRoMtHX9InQlmI3vmGWVARppFhVwbpWQmqOmEn+NQLhGWXKF1GAOMjW gmwcTgU93RgwWM60pR+9GGETx16j21akt+JkkNvAfQrAh1mjejGgu178XJZ8ZXuk6n46 35Q9+NvE6kAqV4F0UzD249r4w1KSBos7Lr8jp2LqTRZajxeSbNPE3VZCtKXcKKQluyvS N4uU5WhH5FAVJP4SdEP5TDF87f151Hmf89HzCQAtPmFH0M6v+2WWwV+kGz1+f/3cachP 5D2w== X-Gm-Message-State: AKS2vOwvSNjEhcJyPtrdW1er/wcaTYObiR+yRh48S9Nc3vS4ubTsZP+D isf1iO2LQLix5ciJ7xjfTABANuPqJnVm X-Received: by 10.202.166.203 with SMTP id t72mr6549231oij.40.1498058737691; Wed, 21 Jun 2017 08:25:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.141.84 with HTTP; Wed, 21 Jun 2017 08:25:37 -0700 (PDT) From: "H.J. Lu" Date: Sun, 01 Jan 2017 00:00:00 -0000 Message-ID: Subject: RFC: Update x86 psABI to support shadow stac To: gnu-gabi@sourceware.org, IA32 System V Application Binary Interface , "x86-64-abi@googlegroups.com" Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-q2/txt/msg00035.txt.bz2 Any comments? -- H.J. --- To support shadow stack (SHSTK) in Intel Control-flow Enforcement Technology (CET) instructions: https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforc ement-technology-preview.pdf following changes to x86 psABI are required. To program properties, add #define GNU_PROPERTY_X86_FEATURE_1_SHSTK (1U << 1) to the GNU_PROPERTY_X86_FEATURE_1_AND property to indicate that all executable sections are compatible with SHSTK where return address popped from shadow stack always matches return address popped from normal stack. GNU_PROPERTY_X86_FEATURE_1_SHSTK is set on output only if it is set on all relocatable inputs, which means that the C library must be compiled with SHSTK-enabled compiler. Load-time processing On a SHSTK capable processor, the following steps should be taken: 1. When loading an executable, if GNU_PROPERTY_X86_FEATURE_1_SHSTK is set on the executable as well as all shared objects loaded via the DT_NEEDED tag, enable SHSTK. 2. After SHSTK is enabled, it is an error to load a shared object without GNU_PROPERTY_X86_FEATURE_1_SHSTK. gnu-6:pts/8[8]> cat shstk.txt /export/gnu/import/git/properties Update x86 psABI to support shadow stack To support shadow stack (SHSTK) in Intel Control-flow Enforcement Technology (CET) instructions: https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technology-preview.pdf following changes to x86 psABI are required. To program properties, add #define GNU_PROPERTY_X86_FEATURE_1_SHSTK (1U << 1) to the GNU_PROPERTY_X86_FEATURE_1_AND property to indicate that all executable sections are compatible with SHSTK where return address popped from shadow stack always matches return address popped from normal stack. GNU_PROPERTY_X86_FEATURE_1_SHSTK is set on output only if it is set on all relocatable inputs, which means that the C library must be compiled with SHSTK-enabled compiler. Load-time processing On a SHSTK capable processor, the following steps should be taken: 1. When loading an executable, if GNU_PROPERTY_X86_FEATURE_1_SHSTK is set on the executable as well as all shared objects loaded via the DT_NEEDED tag, enable SHSTK. 2. After SHSTK is enabled, it is an error to load a shared object without GNU_PROPERTY_X86_FEATURE_1_SHSTK.