This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Also install data-directory into the build directory as computed by relocate_gdb_directory
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: dje at google dot com, khooyp at cs dot umd dot edu, jan dot kratochvil at redhat dot com, gdb-patches at sourceware dot org
- Date: Thu, 4 Oct 2012 06:49:28 -0700
- Subject: Re: [PATCH] Also install data-directory into the build directory as computed by relocate_gdb_directory
- 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> <CC9CEDC8-8941-43A8-88EA-DAB1B671DD32@cs.umd.edu> <20120927091737.GB2980@adacore.com> <CADPb22Q1a2TJ_bR0yq_wjOua8pBqBsZXvyS2uteX9xKiLuC9kw@mail.gmail.com> <20121004000840.GI3028@adacore.com> <83k3v69a1r.fsf@gnu.org>
> 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