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: 802084 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=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-83232-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="J8f7zQCq"; 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 3xXW344Tf7z9sxR for ; Wed, 16 Aug 2017 23:51:12 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type; q=dns; s=default; b=ru4Gc015JU8WEhOZaw1kQY02EaNdC a/aHqmh04srl9xM7mnD4q9XgCPYd8ecPaiuk2u6ov3c1a6BFpwWvWf8E6T6xnIRS Ia+Y/1yTHQuhl224W9WbZ2KOXwWbds3efnafDK2CPH1+vUfehhEHFcWl8/4wyq6q vdxUgZTlClY5CQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type; s=default; bh=ma+3s1T4IFUhjQoAngMCuJBUYmc=; b=J8f 7zQCqZ5HVUfR8TgbRTlWUvSqInuMrj47vbJL3MjBGZpPycBip7tyPowxisAb4fpo rCZkNj/ixZ9qjSih4DUe37DiQmKlGz+KBQmh7g1aFQhZHdekKifdVHV2+vvaTrOk GmpicRQArYYZUd8Fc+0CDwJ0m6VPH6lIp1sfw2hw= 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 ;; *)