Bugtraq mailing list archives
Re: Incorrect behaviour of setre[ug]id in OpenBSD
From: ww () STYX ORG (Will Waites)
Date: Fri, 23 Oct 1998 10:26:01 -0400
Apologies, in my original post I neglected to mention version numbers (it had been a long day). The incorrect behaviour is present in OpenBSD 2.3, and the current source. I don't know about earlier versions. Also, (Free|Net)BSD seem to implement setreuid() and setregid in the kernel, so presumably they are not vulnerable. The problem is in the following two files: src/lib/libc/compat-43/__setreuid.c src/lib/libc/compat-43/__setregid.c I have quickly cobbled together a couple of patches that are avaliable in ftp.styx.org in /pub/openbsd_patches. To apply, $ cd /usr/src/lib/libc/compat-43 $ patch -p0 < /wherever/__setreuid.c.patch $ patch -p0 < /wherever/__setregid.c.patch and then recompile libc. Bear in mind that these are /not/ official OpenBSD patches, and I can take no responsibility to what they may or may not do to your system -- but they should work as advertised in the man page with the following exception: if setreuid(ruid, euid) is called by root, and ruid is not 0, and euid != ruid, the call will fail after doing a setuid(ruid). Cheers, Will -- | Will Waites | "Man is a political and a social animal, and he | | ww () styx org | normally enjoys hearing fantastic answers in | | www.styx.org/~ww | preference to none." -- Joseph Heller | |--------------------------------------------------------------------| | Finger ww () styx org for PGP Public Key |
Current thread:
- SVGATextMode 1.8 /tmp race Adrian Voinea (Oct 21)
- License Manager's lockfiles (Solaris 2.5.1) Joel Eriksson (Oct 21)
- Re : 13 tiny bytes to show the huge sillyness of our great common ga (Oct 23)
- Re: License Manager's lockfiles (Solaris 2.5.1) pedward () WEBCOM COM (Oct 23)
- Re: License Manager's lockfiles (Solaris 2.5.1) Roger Harrison ? (Oct 23)
- Re: License Manager's lockfiles (Solaris 2.5.1) Peter Marelas (Oct 24)
- Re: SVGATextMode 1.8 /tmp race dumped (Oct 22)
- Re: SVGATextMode 1.8 /tmp race Ben Collins (Oct 22)
- Re: SVGATextMode 1.8 /tmp race Marcelo Roccasalva (Oct 23)
- Incorrect behaviour of setre[ug]id in OpenBSD Will Waites (Oct 22)
- Re: Incorrect behaviour of setre[ug]id in OpenBSD Will Waites (Oct 23)
- slocate v1.4 klindsay (Oct 24)
- Re: Incorrect behaviour of setre[ug]id in OpenBSD matthew green (Oct 24)
- HP 11.0 sulog Problem Ron Youngclaus (Oct 26)
- License Manager's lockfiles (Solaris 2.5.1) Joel Eriksson (Oct 21)