From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/423 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: LD_PRELOAD and RTLD_NEXT support Date: Tue, 16 Aug 2011 07:47:30 -0400 Message-ID: <20110816114730.GO132@brightrain.aerifal.cx> References: <20110816051715.GN132@brightrain.aerifal.cx> <20110816063410.GA4254@albatros> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1313495312 23734 80.91.229.12 (16 Aug 2011 11:48:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 16 Aug 2011 11:48:32 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-424-gllmg-musl=m.gmane.org@lists.openwall.com Tue Aug 16 13:48:28 2011 Return-path: Envelope-to: gllmg-musl@lo.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1QtI8C-0006x7-7j for gllmg-musl@lo.gmane.org; Tue, 16 Aug 2011 13:48:28 +0200 Original-Received: (qmail 3856 invoked by uid 550); 16 Aug 2011 11:48:27 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 3842 invoked from network); 16 Aug 2011 11:48:27 -0000 Content-Disposition: inline In-Reply-To: <20110816063410.GA4254@albatros> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:423 Archived-At: 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