From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/421 Path: news.gmane.org!not-for-mail From: Vasiliy Kulikov Newsgroups: gmane.linux.lib.musl.general Subject: Re: LD_PRELOAD and RTLD_NEXT support Date: Tue, 16 Aug 2011 10:34:10 +0400 Message-ID: <20110816063410.GA4254@albatros> References: <20110816051715.GN132@brightrain.aerifal.cx> 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 1313476491 10988 80.91.229.12 (16 Aug 2011 06:34:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 16 Aug 2011 06:34:51 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-422-gllmg-musl=m.gmane.org@lists.openwall.com Tue Aug 16 08:34:47 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 1QtDEd-0005Bm-MC for gllmg-musl@lo.gmane.org; Tue, 16 Aug 2011 08:34:47 +0200 Original-Received: (qmail 11769 invoked by uid 550); 16 Aug 2011 06:34:47 -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 11761 invoked from network); 16 Aug 2011 06:34:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=wY0PE3RNWuLdFB6vdwJOxXKl0OPHR8iwJiNS/yo76AI=; b=izvDm42l4pg7lIDVMfCrL83E6XNkq6+OhBScxOEcyc3GrvRLyd6aHgKyUvddpJpXEf j8dgz43zCaz+HlFCCmVsplEuQ2ok7HWBhD8aUDcDWHiO5FiKBbJxdI75k3b22u/9cthE TvYjRfhMpeob+BTei8F1r8y2fNVuQrSqWf2OY= Original-Sender: Vasiliy Kulikov Content-Disposition: inline In-Reply-To: <20110816051715.GN132@brightrain.aerifal.cx> User-Agent: Mutt/1.5.20 (2009-06-14) Xref: news.gmane.org gmane.linux.lib.musl.general:421 Archived-At: 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). 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 case. Instead, it's better to check for (getuid()!=geteuid() || getgid()!=getegid()). Thanks, -- Vasiliy