From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/424 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 16:46:00 +0400 Message-ID: <20110816124600.GA15681@albatros> References: <20110816051715.GN132@brightrain.aerifal.cx> <20110816063410.GA4254@albatros> <20110816114730.GO132@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 1313498827 14005 80.91.229.12 (16 Aug 2011 12:47:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 16 Aug 2011 12:47:07 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-425-gllmg-musl=m.gmane.org@lists.openwall.com Tue Aug 16 14:46:58 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 1QtJ2l-0007SD-3z for gllmg-musl@lo.gmane.org; Tue, 16 Aug 2011 14:46:55 +0200 Original-Received: (qmail 3924 invoked by uid 550); 16 Aug 2011 12:46:45 -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 3905 invoked from network); 16 Aug 2011 12:46:45 -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=yttbLdZXkeCPQRDm7kH5qMzbItQjusv9SNWT7BFuxNk=; b=A1/yaxTzVBr2Hzibq8We9ZuqDboqQNmLZYr9J7aMiv5TCCNLLhBetCblm34ZcvrUZQ kzFibqlZtPTegDFq5ps/r+CeOJnyVj95H/GHyWNil3PhqaSOBi8gTZZm3WxbWAw/bOMp Ekc1OkUnj1TU91dAq6z/N+Tjp2E1PRThlCqEA= Original-Sender: Vasiliy Kulikov Content-Disposition: inline In-Reply-To: <20110816114730.GO132@brightrain.aerifal.cx> User-Agent: Mutt/1.5.20 (2009-06-14) Xref: news.gmane.org gmane.linux.lib.musl.general:424 Archived-At: On Tue, Aug 16, 2011 at 07:47 -0400, Rich Felker wrote: > > 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? Looks like so. glibc has some crazy dance with these flags and get*id() values, which we patch in Owl ;-) > > 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. Ah, sure. ...btw, I feel it would be cleaner if you check for untrusted environment at the time of initializing env_* variables. Currently there is not much code between env_X assignment and zeroing, but it might be in the future (with addition of ld features, etc.). for (p = argv+i; ... ) { if (is_secure_env) env_path = ... -- Vasiliy