oss-sec mailing list archives

Re: libdbus hardening


From: Sebastian Krahmer <krahmer () suse de>
Date: Tue, 10 Jul 2012 16:14:33 +0200

On Tue, Jul 10, 2012 at 06:07:03PM +0400, Solar Designer wrote:
On Tue, Jul 10, 2012 at 03:58:46PM +0200, Florian Weimer wrote:
On 07/10/2012 03:43 PM, Solar Designer wrote:
We already have __secure_getenv() in glibc, which I think is what
libraries like this should be using on systems with glibc.

Sebastian's patches also include a check on prctl(PR_GET_DUMPABLE).  I'm 
not sure if the libc approach (compare effective and real UIDs/GIDs on 
process start and base process environment trust decisions on that) is 
equivalent.

glibc also uses AT_SECURE.

PR_GET_DUMPABLE catches the extra case of a process that started e.g. as
root and has since switched creds, but do we actually want to restrict
processing of env vars in that case?  Perhaps not, and so AT_SECURE is
more appropriate.

It is indeed, if you are inside libc. :) But I dont want to parse /proc/self/auxv
from libdbus and do not know any other portable way (I dont want to walk
the stack base either to find auxv).
Maybe my patch is even breaking dbus daemon itself, if it dropped to dbus user?

Thats someting upstream could tell us :)

Sebastian

-- 

~ perl self.pl
~ $_='print"\$_=\47$_\47;eval"';eval
~ krahmer () suse de - SuSE Security Team

---
SUSE LINUX Products GmbH,
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
Maxfeldstraße 5
90409 Nürnberg
Germany


Current thread: