From: "Michael Potter" <pottmi@gmail.com>
To: "Michael Potter" <pottmi@gmail.com>, gdb@sourceware.org
Subject: Re: unable to attach to setuid program that as reverted it privilege
Date: Tue, 22 Jan 2008 20:24:00 -0000 [thread overview]
Message-ID: <2379dacc0801221223o155001a4gdb610b91d1d282d9@mail.gmail.com> (raw)
In-Reply-To: <20080122200856.GA20301@caradoc.them.org>
On Jan 22, 2008 2:08 PM, Daniel Jacobowitz <drow@false.org> wrote:
> On Tue, Jan 22, 2008 at 01:59:48PM -0600, Michael Potter wrote:
> > I will speculate that the logic behind that is even tho the program
> > does not have root privilege now, it could have something in left over
> > in memory from when it did have root privilege. I think this is a
>
> Correct. For instance, it could have an open file descriptor to a
> root-owned file or a privileged network socket. There's lots of
> things you can inherit.
>
> > good default behavior, but I am hopeful that some clever programmer
> > has found a way to change their program such that gdb can attach to
> > it.
>
> It has nothing to do with the program; this is part of your kernel's
> security model. Sorry. I believe it's pretty much universal behavior
> across Unix-like systems.
>
> > Suggestions on alternatives such as a way to switch users without root
> > privileges
> > are welcome.
>
> Allow "sudo -u otheruser ./nonsetuid-copy-of-program" ?
>
My program is a daemon process that runs as root.
When it starts is reduces it's privilege and it returns its privilege
to just long enough to validate the user's password.
It then forks. The child returns its root priv to do the one way
switch to the new user.
The reason I think someone may have a solution to this (even if it is
a hack) is that exec will solve the problem. I do not want to add an
exec to my code because I do not want the overhead of exec.
I am thinking that someone may have written a loadable kernel module
that would be tweak the same bit that exec tweaks that would allow the
connect. That module would be called by the program.
> --
> Daniel Jacobowitz
> CodeSourcery
>
next prev parent reply other threads:[~2008-01-22 20:24 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 [this message]
2008-01-23 17:52 ` Mark Kettenis
2008-01-23 18:48 ` Michael Potter
2008-01-23 20:26 ` Michael Potter
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=2379dacc0801221223o155001a4gdb610b91d1d282d9@mail.gmail.com \
--to=pottmi@gmail.com \
--cc=gdb@sourceware.org \
/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