From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6580 Path: news.gmane.org!not-for-mail From: Christoph Hellwig Newsgroups: gmane.comp.lib.glibc.alpha,gmane.linux.lib.musl.general,gmane.linux.kernel.api Subject: Re: [musl] Re: [RFC] Possible new execveat(2) Linux syscall Date: Fri, 21 Nov 2014 02:10:15 -0800 Message-ID: <20141121101015.GF8866@infradead.org> References: <20141116195246.GX22465@brightrain.aerifal.cx> <20141116220859.GY22465@brightrain.aerifal.cx> <20141116233202.GA22465@brightrain.aerifal.cx> <20141117183010.GE22465@brightrain.aerifal.cx> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1416564638 22410 80.91.229.3 (21 Nov 2014 10:10:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Nov 2014 10:10:38 +0000 (UTC) Cc: David Drysdale , Andy Lutomirski , libc-alpha , musl@lists.openwall.com, Andrew Morton , Linux API , Christoph Hellwig To: Rich Felker Original-X-From: libc-alpha-return-54609-glibc-alpha=m.gmane.org@sourceware.org Fri Nov 21 11:10:32 2014 Return-path: Envelope-to: glibc-alpha@plane.gmane.org Original-Received: from server1.sourceware.org ([209.132.180.131] helo=sourceware.org) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XrlAc-00061q-N3 for glibc-alpha@plane.gmane.org; Fri, 21 Nov 2014 11:10:31 +0100 DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; q=dns; s=default; b=uXwr r4o94hFp8zVOqUaq0ZnCMu4OsvfWGnUA7lXZXDUMU/FNyxp6AC+20KZNczRNGehX jOjc78mX2Sz1ejOH4skc/YGUEIO8hCUc8toqK9wSHeICxxt41G/fW9vjHRq3pnfe x9RredqfYueNdwDUc+DQpCPMNskyGYNgHInJumo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; s=default; bh=ziEjfCOyH+ ENazyu8vK0N1sgK6A=; b=Jro/uQJjgCfBX2+GDeMBipnhRrcemYbTD5VTXvgfm+ jwfC0pLmzeiEN1i5Qy82jjct7G9mePpxyNS9MLroUyEY7Ns+t14Zjn54A3vrE3yF enaH1pb0uqLnzZrL3XFMO9XLewrWKenmOr65x8xBbvsxJDQM9RORKjGVaip/MlpM Q= Original-Received: (qmail 32267 invoked by alias); 21 Nov 2014 10:10:27 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Original-Sender: libc-alpha-owner@sourceware.org Original-Received: (qmail 32253 invoked by uid 89); 21 Nov 2014 10:10:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: bombadil.infradead.org Content-Disposition: inline In-Reply-To: <20141117183010.GE22465@brightrain.aerifal.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Xref: news.gmane.org gmane.comp.lib.glibc.alpha:46905 gmane.linux.lib.musl.general:6580 gmane.linux.kernel.api:6290 Archived-At: On Mon, Nov 17, 2014 at 01:30:10PM -0500, Rich Felker wrote: > On Mon, Nov 17, 2014 at 03:42:15PM +0000, David Drysdale wrote: > > I'm not familiar with O_EXEC either, I'm afraid, so to be clear -- does > > O_EXEC mean the permission check is explicitly skipped later, at execute > > time? In other words, if you open(O_EXEC) an executable then remove the > > execute bit from the file, does a subsequent fexecve() still work? > > Yes. It's just like how read and write permissions work. If you open a > file for read then remove read permissions, or open it for write then > remove write permissions, the existing permissions to the open file > are not lost. Of course open with O_EXEC/O_SEARCH needs to fail if the > caller does not have +x access to the file/directory at the time of > open. Adding a FMODE_EXEC similar to FMODE_READ/WRITE would be trivial.