Util-Linux package development
 help / color / mirror / Atom feed
From: Ludwig Nussel <ludwig.nussel@suse.de>
To: Bernhard Voelker <mail@bernhard-voelker.de>
Cc: "util-linux@vger.kernel.org" <util-linux@vger.kernel.org>
Subject: Re: su: calling setsid() for -c only if non-root user?
Date: Wed, 06 Jun 2012 14:41:33 +0200	[thread overview]
Message-ID: <4FCF4FFD.70204@suse.de> (raw)
In-Reply-To: <4FCF441C.1090400@bernhard-voelker.de>

Bernhard Voelker wrote:
> I am playing around with the --command and --session-command options of su,
> and I noticed that setsid() is only called iff a non-root new_user is given:
> [...]
> Why is the setsid() call dependent on the user?

First of all, this is a really nasty (mis-)feature. Introduced due to
abuse of su for things it shouldn't be used for in the first place.
The attack scenario are e.g. package %post scripts that execute commands
on behalf of some unprivileged daemon user. If such an account got
compromised the attacker might escalate privileges to root e.g. when
root installs updates for the daemon in question.
setsid() prevents injecting characters into the tty input buffer of root
in this case.
This kind of attack doesn't make sense if the target user is root as
that would mean the root account is compromised already.

cu
Ludwig

-- 
 (o_   Ludwig Nussel
 //\
 V_/_  http://www.suse.de/
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) 

  reply	other threads:[~2012-06-06 12:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-06 11:50 su: calling setsid() for -c only if non-root user? Bernhard Voelker
2012-06-06 12:41 ` Ludwig Nussel [this message]
2012-06-06 13:07   ` Bernhard Voelker

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=4FCF4FFD.70204@suse.de \
    --to=ludwig.nussel@suse.de \
    --cc=mail@bernhard-voelker.de \
    --cc=util-linux@vger.kernel.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