Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 16 Aug 2011 07:47:30 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Re: LD_PRELOAD and RTLD_NEXT support

On Tue, Aug 16, 2011 at 10:34:10AM +0400, Vasiliy Kulikov wrote:
> Rich,
> 
> On Tue, Aug 16, 2011 at 01:17 -0400, Rich Felker wrote:
> > (fully disabled for any suid/sgid binary)
> 
>         if ((aux[0]&0x7800)!=0x7800 || aux[AT_UID]!=aux[AT_EUID]
>           || aux[AT_GID]!=aux[AT_EGID]) {
> 
> Two things here:
> 
> 1) This check should be extended to support AT_SECURE (dumpable flag,
> any LSM security domains, capabilities).

Indeed, I'll add this. Do I just check for aux[AT_SECURE] != 0?

> 2) As you check for (aux[0] & 0x7800) you assume some of these elements
> can be absent.  I feel it's wrong to assume you're not s*id'ed in this

You misread the test. Absence of any of the 4 fields causes the
program to be treated as if it were suid.

> case.  Instead, it's better to check for (getuid()!=geteuid() ||
> getgid()!=getegid()).

I don't see how this helps, and this takes us down the glibc path of
abysmal startup times for every tiny program called from ./configure,
which is the reason ./configure takes so damn long...

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.