Re: Linux kernel setgid implementation flaw

From: FozZy (fozzy@dmpfrance.com)
Date: 07/19/02


Date: Fri, 19 Jul 2002 22:19:39 +0200
From: FozZy <fozzy@dmpfrance.com>
To: bugtraq@securityfocus.com

Thanks, it's a great paper. Unix developpers: it should be worth taking a look at it.

Indeed, with their rigourous methodology, the authors did detect this error in the setgid linux manpage on Red Hat 7.2. I just wonder if they reported it (the manpage on www.linux.org is still inaccurate at the moment).
This paper also reports a real example of a program with the setgid flag only, that thinks it can drop all privileges by calling setgid(getgid()). It is OK on FreeBSD, but not on Linux...

Another interesting example is a setuid program with a non-root owner that want to drop its privileges. (I use here the word "privilege" in an extensive and empiric "having access to objects on the system that are forbidden to the current user"). Well, on Linux and Solaris, this program will not properly drop privileges by the usual way: calling setgid() then setuid(). The saved uid and gid will remain the owner's ones.

And much more interesting stuff... :)

FozZy

On Fri, 19 Jul 2002 12:48:49 -0400 (EDT)
wietse@porcupine.org (Wietse Venema) wrote:

> FYI,
>
> The August USENIX Security conference has a good paper that examines
> in depth the semantics of UID and GID setting calls for Solaris,
> FreeBSD and Linux. The differences are quite remarkable.
>
> Wietse
>
> Setuid Demystified, by Hao Chen, David Wagner, UC Berkeley; Drew
> Dean, SRI International
> www.cs.berkeley.edu/~daw/papers/setuid-usenix02.pdf



Relevant Pages

  • Re: Linux kernel setgid implementation flaw
    ... it should be worth taking a look at it. ... This paper also reports a real example of a program with the setgid flag only, that thinks it can drop all privileges by calling setgid). ... It is OK on FreeBSD, but not on Linux... ...
    (Bugtraq)
  • Re: Slightly OT - linux OS and walking applications
    ... As pointed before, FreeBSD is ... not Linux based .. ... features, it worth a try. ... useful applications are little known and are spread about ...
    (uk.rec.walking)
  • Re: What good can FreeBSD do? (in the presence of OpenBSD)
    ... FreeBSD and Linux have essentially the same network performance. ... Samba is an entirely different story. ... Google to find a lot of reports on that problem. ...
    (comp.unix.bsd.freebsd.misc)
  • Re: FreeBSD 4.x Opteron Question
    ... the FreeBSD developers told everyone that 5.3 was da ... initially over linux not because there's a bunch of good guys on the ... My tests measure kernel performance; ... > a networking device is a key performance indicator. ...
    (freebsd-questions)
  • Re: Newbie Experience
    ... I've only been around since FreeBSD 5.4 ... FreeBSD kernel too. ... always sunshine and linux is farts. ... in the hey day of AT&T Unix I'm ...
    (freebsd-questions)