From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123886 invoked by alias); 27 Jul 2017 15:44:39 -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 91195 invoked by uid 89); 27 Jul 2017 15:44:16 -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=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=prudent, complies, isolation X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_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: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Jul 2017 15:44:15 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E381DC00DBBD; Thu, 27 Jul 2017 15:44:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E381DC00DBBD Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer@redhat.com Received: from oldenburg.str.redhat.com (dhcp-192-212.str.redhat.com [10.33.192.212]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CEC905C269; Thu, 27 Jul 2017 15:44:12 +0000 (UTC) Subject: Re: RFC: Update x86 psABI to support shadow stac To: "H.J. Lu" Cc: gnu-gabi@sourceware.org, IA32 System V Application Binary Interface , "x86-64-abi@googlegroups.com" , "Shanbhogue, Vedvyas" References: <53356291-bb6d-3a69-3dc7-4a1f011942bd@redhat.com> <4a0a3d70-ff4b-9c99-810a-4537d5415594@redhat.com> From: Florian Weimer Message-ID: <20561ce4-e433-618b-86fd-5d74dbf0e56e@redhat.com> Date: Sun, 01 Jan 2017 00:00:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 27 Jul 2017 15:44:14 +0000 (UTC) X-IsSubscribed: yes X-SW-Source: 2017-q3/txt/msg00000.txt.bz2 On 06/28/2017 01:21 PM, H.J. Lu wrote: > On Wed, Jun 28, 2017 at 2:58 AM, Florian Weimer wrote: >> On 06/22/2017 08:44 PM, H.J. Lu wrote: >>>> The responsibilities for compliance are split between caller and callee, >>>> which can live in different shared objects. I think it would be prudent >>>> to formulate the requirement in such a way that compliance can be >>>> checked by looking at one DSO in isolation. >> >>> What do you mean by it? >> >> I suggest to word the ABI requirement in such a way that it is possible >> to verify if a shared object complies with it isolation, independent of >> how its functions are called. >> > > 99% of existing binaries are compatible with shadow stack. I find that surprising, or does this number to refer to x86-64 binaries only? > It is hard > to tell just by looking at assembly instructions. If shadow stack is enabled, > compiler should turn on the SHSTK bit in output: > > [hjl@gnu-tools-1 32]$ readelf -n crtprec32.o > > Displaying notes found in: .note.gnu.property > Owner Data size Description > GNU 0x0000000c NT_GNU_PROPERTY_TYPE_0 > Properties: x86 feature: IBT > GNU 0x0000000c NT_GNU_PROPERTY_TYPE_0 > Properties: x86 feature: SHSTK > [hjl@gnu-tools-1 32]$ > > I don't know if it is sufficient for verification. The ABI document needs to specify what the flag means. I don't think it's sufficient to essentially say, “the toolchain did or did not do some unspecified stuff and we believe the binary is now compatible with the shadow stack feature”. Florian