From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27429 invoked by alias); 20 Apr 2010 21:38:41 -0000 Received: (qmail 27415 invoked by uid 22791); 20 Apr 2010 21:38:40 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SARE_MSGID_LONG45,SPF_HELO_PASS,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Apr 2010 21:38:33 +0000 Received: from kpbe19.cbf.corp.google.com (kpbe19.cbf.corp.google.com [172.25.105.83]) by smtp-out.google.com with ESMTP id o3KLcUmi023936 for ; Tue, 20 Apr 2010 23:38:30 +0200 Received: from pzk40 (pzk40.prod.google.com [10.243.19.168]) by kpbe19.cbf.corp.google.com with ESMTP id o3KLc03J021778 for ; Tue, 20 Apr 2010 14:38:29 -0700 Received: by pzk40 with SMTP id 40so4546281pzk.23 for ; Tue, 20 Apr 2010 14:38:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.247.17 with HTTP; Tue, 20 Apr 2010 14:38:28 -0700 (PDT) In-Reply-To: References: <20100416070540.4205E84396@ruffy.mtv.corp.google.com> Date: Tue, 20 Apr 2010 21:38:00 -0000 Received: by 10.141.188.8 with SMTP id q8mr6576471rvp.140.1271799508740; Tue, 20 Apr 2010 14:38:28 -0700 (PDT) Message-ID: Subject: Re: [RFA] [1/2] auto-loading scripts from .debug_gdb_scripts section From: Doug Evans To: tromey@redhat.com Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes 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: 2010-04/txt/msg00647.txt.bz2 On Tue, Apr 20, 2010 at 12:13 PM, Tom Tromey wrote: >>>>>> "Doug" =3D=3D Doug Evans writes: > > Doug> This patch adds support for auto-loading scripts mentioned in > Doug> section .debug_gdb_scripts. > > It seems reasonable to me. =A0I 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. =A0But, 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. =A0I don't know why I didn't think > of this before :-(. =A0The 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. =A0I 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.