Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michael Elizabeth Chastain <mec@shout.net>
To: gdb@sources.redhat.com, kewarken@qnx.com
Subject: Re: gdb and suid binaries - security?
Date: Wed, 03 Apr 2002 07:52:00 -0000	[thread overview]
Message-ID: <200204031552.g33FqUm04939@duracef.shout.net> (raw)

This is a well known case.  The kernel does a permission check at the
time that the parent starts tracing the child (or Process A attaches to
Process B).  In the linux kernel, this check is in "ptrace_attach"
in file kernel/ptrace.c.

> Oddly enough I've noticed that this actually fails on both FreeBSD
> and Linux but it almost seems to be some mechanism outside of gdb.
> Does anyone know how this works?

gdb is an unprivileged process.  It just calls ptrace() a lot, or it
reads and write /proc a lot.  It's the kernel's job to deny gdb from
attaching to privileged processes, just as it's the kernel's job to deny
"cat > /etc/passwd" for unprivileged users.

Michael C


             reply	other threads:[~2002-04-03 15:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-03  7:52 Michael Elizabeth Chastain [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-04-03  7:26 Kris Warkentin
2002-04-03  7:32 ` Gianni Mariani

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=200204031552.g33FqUm04939@duracef.shout.net \
    --to=mec@shout.net \
    --cc=gdb@sources.redhat.com \
    --cc=kewarken@qnx.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