From patchwork Mon Oct 13 00:07:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allan McRae X-Patchwork-Id: 399029 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 AF2E0140076 for ; Mon, 13 Oct 2014 11:07:54 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=CXh7GZHv3awKeght1fCQ6pzn12rAIEtE72K0eg9bRIZ4Zsgccb0eV Vy2/EYoP3nJSihrNkMRuPbkM/KaUwvXjekFQYdogw/eJ/hejwGOgJdre2IrmEIwC yFzrlOGDdm3AunEz8TEC4V59HiFlLFaA694a7iEIrxnAN9W2bELxPQ= 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:from:to:subject:date:message-id; s=default; bh=tvSL1Wzcfd1HfIHxny9qHnNBJHs=; b=qxENVDgI0zqVOyB81Czm2lM/sMHg 0f1PiuwXEwBULmAzlxb+GmWPXaw95tz2rKRw2PqmRhIMFsg3SIsQazHznRSebbR6 Vi/SfkHKpL6BD81sXiNgGmSs5DKrC5ypCZs7phr3WbvdN54/QH12A2ik95sj+jD7 Zj6fXYN4giBnw7Y= Received: (qmail 7789 invoked by alias); 13 Oct 2014 00:07:47 -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 7775 invoked by uid 89); 13 Oct 2014 00:07:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: nymeria.archlinux.org From: Allan McRae To: libc-alpha@sourceware.org Subject: [PATCH] * elf/dl-load.c (open_path): avoid writing to 'env_path_list' when none of the search directories exist. Date: Mon, 13 Oct 2014 10:07:26 +1000 Message-Id: <1413158846-7075-1-git-send-email-allan@archlinux.org> From: Bram --- This patch was submitted to BZ#15378 over a year ago. I have an Arch Linux user running into this bug who confirms the patch fixes their issues. ChangeLog: 2014-10-xx Bram [BZ #15378] * elf/dl-load.c (open_path): Avoid writing to 'env_path_list' when none of the search directories exist. elf/dl-load.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/elf/dl-load.c b/elf/dl-load.c index 9dd40e3..3ac64f3 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -1897,9 +1897,9 @@ open_path (const char *name, size_t namelen, int mode, if (sps->malloced) free (sps->dirs); - /* rtld_search_dirs is attribute_relro, therefore avoid writing - into it. */ - if (sps != &rtld_search_dirs) + /* rtld_search_dirs and env_path_list are attribute_relro, therefore + avoid writing into it. */ + if (sps != &rtld_search_dirs && sps != &env_path_list) sps->dirs = (void *) -1; }