From patchwork Wed Aug 16 13:48:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 22141 Received: (qmail 92084 invoked by alias); 16 Aug 2017 13:50:10 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 10781 invoked by uid 89); 16 Aug 2017 13:48:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=our X-HELO: mx1.redhat.com DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 616235117D Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer@redhat.com To: GNU C Library From: Florian Weimer Subject: [PATCH] ldd: never run file directly Message-ID: Date: Wed, 16 Aug 2017 15:48:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 We have this old patch in our packages. I think most distributions use something similar, as a guard against surprises. Can we finally apply this upstream? Thanks, Florian From 83e5edd390eabe8f8e8e0d051f929b77a30c0767 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 18 Mar 2011 16:22:52 +0100 Subject: [PATCH] ldd: never run file directly * elf/ldd.bash.in: Never run file directly. --- ChangeLog | 4 ++++ elf/ldd.bash.in | 14 +------------- 2 files changed, 5 insertions(+), 13 deletions(-) --- a/elf/ldd.bash.in +++ b/elf/ldd.bash.in @@ -166,18 +166,6 @@ warning: you do not have execution permission for" "\`$file'" >&2 fi done case $ret in - 0) - # If the program exits with exit code 5, it means the process has been - # invoked with __libc_enable_secure. Fall back to running it through - # the dynamic linker. - try_trace "$file" - rc=$? - if [ $rc = 5 ]; then - try_trace "$RTLD" "$file" - rc=$? - fi - [ $rc = 0 ] || result=1 - ;; 1) # This can be a non-ELF binary or no binary at all. nonelf "$file" || { @@ -185,7 +173,7 @@ warning: you do not have execution permission for" "\`$file'" >&2 result=1 } ;; - 2) + 0|2) try_trace "$RTLD" "$file" || result=1 ;; *)