Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Michael Potter" <pottmi@gmail.com>
To: "Mark Kettenis" <mark.kettenis@xs4all.nl>
Cc: gdb@sourceware.org
Subject: Re: unable to attach to setuid program that as reverted it privilege
Date: Wed, 23 Jan 2008 20:26:00 -0000	[thread overview]
Message-ID: <2379dacc0801231226h4b62928dk5c3fdc36fc9fcbbe@mail.gmail.com> (raw)
In-Reply-To: <2379dacc0801231048l655f3463y748a41c7a4ab8b49@mail.gmail.com>

On Jan 23, 2008 12:48 PM, Michael Potter <pottmi@gmail.com> wrote:
>
> On Jan 23, 2008 11:52 AM, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> > > Date: Tue, 22 Jan 2008 13:59:48 -0600
> > > From: "Michael Potter" <pottmi@gmail.com>
> > >
> > > Gdb Crew,
> > >
> > > I get this error when attaching to a setuid program that has
> > > _given_up_ its root privilege setuid(getuid()):
> > >
> > > ---------------------
> > > x~> gdb -p 19484
> > > GNU gdb 6.5
> > > Copyright (C) 2006 Free Software Foundation, Inc.
> > > GDB is free software, covered by the GNU General Public License, and
> > > you are
> > > welcome to change it and/or distribute copies of it under certain
> > > conditions.
> > > Type "show copying" to see the conditions.
> > > There is absolutely no warranty for GDB.  Type "show warranty" for
> > > details.
> > > This GDB was configured as "i586-suse-linux".
> > > Attaching to process 19484
> > > ptrace: Operation not permitted.            <<<<<=================
> >
> > This is the only acceptable behaviour.  The program might have dropped
> > root priviliges but it might still hold resources acquired when it
> > still had those priviliges and you might be able to exploit those.
> >
> > You should be able to attach to the process as root.  If not, complain
> > to the Linux kernel people.
> >
> >
>
> You are my point for me.
> I really really really do not want to give me programmers the ability
> to run the debugger as root.
>
> I think disallowing the attach is the only acceptable _default_
> behavior; but I think I should be able to override that default when I
> am confident that my program does not hold any privileged resources.
>
> I will post to a Linux kernel list in a couple of days.  I posted here
> because I felt that I was likely to find someone who had the same
> problem in this group.
>
> If I have to allow the programmers to run the debugger as root I will
> have to wrap it in a script that will prevent them from attaching to
> any other process than the ones that I can programmaticaly identify as
> ok.  Is there any option on gcc that will disable gcc commands that
> might be used to attach to other processes once they have started gcc
> as root?

oops, my brain was thinking gdb, my fingers typed gcc.

>
> Thanks all for your thoughtful replies.
>
> --
> Michael Potter
>


  reply	other threads:[~2008-01-23 20:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-22 20:00 Michael Potter
2008-01-22 20:09 ` Daniel Jacobowitz
2008-01-22 20:24   ` Michael Potter
2008-01-23 17:52 ` Mark Kettenis
2008-01-23 18:48   ` Michael Potter
2008-01-23 20:26     ` Michael Potter [this message]
2008-01-23 20:42     ` Andreas Schwab
2008-01-24  5:05       ` Michael Potter
2008-01-24  9:18         ` Andreas Schwab
2008-04-14 13:46 Reynolds, Brandon
2008-04-14 16:32 ` Michael Potter
2008-04-14 16:45 ` Tavis Ormandy
2008-04-15  1:02   ` Reynolds, Brandon
2008-04-15  1:24     ` Michael Potter

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=2379dacc0801231226h4b62928dk5c3fdc36fc9fcbbe@mail.gmail.com \
    --to=pottmi@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    /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