From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14752 invoked by alias); 4 Oct 2012 13:49:45 -0000 Received: (qmail 14739 invoked by uid 22791); 4 Oct 2012 13:49:43 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Oct 2012 13:49:38 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 964791C7EBA; Thu, 4 Oct 2012 09:49:37 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id wK+5bKlDwwBY; Thu, 4 Oct 2012 09:49:37 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 451291C7BE8; Thu, 4 Oct 2012 09:49:37 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 13258CB4C8; Thu, 4 Oct 2012 15:49:28 +0200 (CEST) Date: Thu, 04 Oct 2012 13:49:00 -0000 From: Joel Brobecker To: Eli Zaretskii Cc: dje@google.com, khooyp@cs.umd.edu, jan.kratochvil@redhat.com, gdb-patches@sourceware.org Subject: Re: [PATCH] Also install data-directory into the build directory as computed by relocate_gdb_directory Message-ID: <20121004134927.GL3028@adacore.com> References: <2878953E-B698-43F3-989A-A551D96BAB62@cs.umd.edu> <20120924152641.GF4146@adacore.com> <9F52A338-A158-44DC-90C1-F46503859613@cs.umd.edu> <285502C6-1395-4049-9D55-031EDA3AD06D@cs.umd.edu> <20120924170348.GI4146@adacore.com> <20120927091737.GB2980@adacore.com> <20121004000840.GI3028@adacore.com> <83k3v69a1r.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83k3v69a1r.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-10/txt/msg00070.txt.bz2 > Why not? Aren't there specific directories and/or files near the GDB > executable in this case? I have a feeling that this would open the door allowing attackers to setup GDB to execute unwanted code if we make it easy to reproduce the same environment and place GDB in a mode where it thinks it is inside a build directory. What we need, I think, is a way to tie the build to the data directory in a way that would be very very hard to forge, like keeping a signature of one of the files in the data directory - but for that to work, we'd need something to be random in that file. And then exclude that file from being installed. Once we have that, we can modify GDB to check ./data-directory/ for the special file before setting the data-directory... But beyond this technical aspect, I am reluctant to add a mode to GDB that would then become useless to 99% of the people once GDB is properly installed. I don't think that the convenience it provides is important enough to justify it. That being said: I am not opposed to this idea at all. If people find a way to implement this and gets approved, that's absolutely OK with me! -- Joel