From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80643 invoked by alias); 29 Mar 2018 09:39:13 -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 80468 invoked by uid 89); 29 Mar 2018 09:39:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.4 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=our, HContent-Transfer-Encoding:8bit X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no 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 mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 29 Mar 2018 09:39:11 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4A895404084A; Thu, 29 Mar 2018 09:39:10 +0000 (UTC) Received: from oldenburg.str.redhat.com (dhcp-192-212.str.redhat.com [10.33.192.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB20C10B2B42; Thu, 29 Mar 2018 09:39:09 +0000 (UTC) Subject: Re: RFC: Audit external function called indirectly via GOT To: "H.J. Lu" Cc: Generic System V Application Binary Interface , gnu-gabi@sourceware.org References: <20180317133115.GA4681@gmail.com> From: Florian Weimer Message-ID: Date: Mon, 01 Jan 2018 00:00:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 29 Mar 2018 09:39:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 29 Mar 2018 09:39:10 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'fweimer@redhat.com' RCPT:'' X-IsSubscribed: yes X-SW-Source: 2018-q1/txt/msg00033.txt.bz2 On 03/28/2018 08:41 PM, H.J. Lu wrote: >> I don't see why it would need JUMP_SLOT relocations if it simply >> auto-generates PLT stub equivalents and installs them in GLOB_DAT >> relocations. > > My understanding is that LD_AUDIT is based on JUMP_SLOT relocations. The current implementation on x86, yes, to avoid the need for run-time code generation. But that doesn't mean it's the best way forward. Certainly not if the toolchain no longer generates JUMP_SLOT relocations (like it did at some point in the past). >> Anyway, going back to the larger question what we need here. >> >> I used this as a test case for audit support with BIND_NOW: >> >> latrace /bin/true --help >> >> Most of Fedora is compiled with BIND_NOW. Fedora 26 does not print latrace >> messages (the problem I mentioned earlier), Fedora 27 works (yay), Fedora 28 >> crashes (meh). >> >> So depending on which side Fedora 28+ falls, I think your approach might be >> viable. I expect that a future binutils version would do this by default, >> and beyond the additional dynamic section tags, new PLT stubs would only be >> created for no-plt functions because current binutils is supposed to >> generate PLT entries again (after they went missing for -z now binaries for >> some time). > -fno-plt is a compiler option, not a linker option. Linker generates PLT for > PLT32 relocations to external functions. That doesn't change the point—if future binutils versions elide JUMP_SLOT relocations, then your proposal is not going to solve our issue. As I wrote, I cannot verify the current state because the toolchain regressed again. Thanks, Florian