Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: tromey@redhat.com
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] [1/2] auto-loading scripts from .debug_gdb_scripts section
Date: Tue, 20 Apr 2010 21:38:00 -0000	[thread overview]
Message-ID: <h2qe394668d1004201438u54e94269p8f6589a2ba8dfd42@mail.gmail.com> (raw)
In-Reply-To: <m3tyr6ey3p.fsf@fleche.redhat.com>

On Tue, Apr 20, 2010 at 12:13 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Doug" == Doug Evans <dje@google.com> writes:
>
> Doug> This patch adds support for auto-loading scripts mentioned in
> Doug> section .debug_gdb_scripts.
>
> It seems reasonable to me.  I looked through the patch and didn't see
> anything I disagreed with.

Great.

> I'm curious why these new scripts are attached to the program space and
> not just the objfile from which the section came.  But, I don't think it
> really matters.

In the case of multiple scripts each being defined in multiple
objfiles, I wanted to minimize the accumulated number of scripts one
had to deal with (there could be *lots* of duplicates).  Once one does
that one can't attach scripts to objfiles because one doesn't
necessarily want the script to go away if the objfile goes away.  I
had a patch that reference counted them, but it seemed excessive for
now so I abandoned it.

> I'm somewhat concerned about security.  I don't know why I didn't think
> of this before :-(.  The issue is that either approach can result in
> random Python code being loaded into gdb.
>
> One idea for a fix would be to check the script file's ownership and
> permissions before reading it.  I think we'd need to allow files to be
> owned by the current user or by root in order for this to work nicely in
> the distro case.

That's probably the right default  choice, but I can imagine wanting
more flexibility.


      reply	other threads:[~2010-04-20 21:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-16  7:06 Doug Evans
2010-04-16  9:38 ` Eli Zaretskii
2010-04-16 18:06   ` Doug Evans
2010-04-16 21:25     ` Eli Zaretskii
2010-04-20 21:45       ` Doug Evans
2010-04-21 19:23         ` Doug Evans
2010-04-21 20:39           ` Eli Zaretskii
2010-04-21 21:54             ` Doug Evans
2010-04-22  3:13               ` Eli Zaretskii
2010-04-23 18:10                 ` Doug Evans
2010-04-20 19:13 ` Tom Tromey
2010-04-20 21:38   ` Doug Evans [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=h2qe394668d1004201438u54e94269p8f6589a2ba8dfd42@mail.gmail.com \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox