From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 0B61C1F9E0 for ; Tue, 28 Apr 2020 17:15:39 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3F98C3954C4E; Tue, 28 Apr 2020 17:15:38 +0000 (GMT) Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id 807FB385DC32 for ; Tue, 28 Apr 2020 17:15:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 807FB385DC32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=fw@deneb.enyo.de Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1jTTpV-0003Wz-MS; Tue, 28 Apr 2020 17:15:33 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1jTTpV-0008NV-Gh; Tue, 28 Apr 2020 19:15:33 +0200 From: Florian Weimer To: Joseph Myers Subject: Re: [PATCH] Linux: Add execveat system call wrapper References: <20200428122019.26826-1-ahajkova@redhat.com> <87v9ljodfl.fsf@mid.deneb.enyo.de> Date: Tue, 28 Apr 2020 19:15:33 +0200 In-Reply-To: (Joseph Myers's message of "Tue, 28 Apr 2020 15:29:07 +0000") Message-ID: <87blnbo7ka.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: libc-alpha@sourceware.org, Alexandra =?iso-8859-1?Q?H=E1jkov=E1?= Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" * Joseph Myers: > On Tue, 28 Apr 2020, Florian Weimer wrote: > >> * Joseph Myers: >> >> > This patch needs documentation for the new function in the glibc manual, >> > as well as a NEWS entry for it (under "Major new features" for 2.32). >> >> The documentation will conflict with the manual update for the >> existing fexecve function, so that should be reviewed first: >> >> > > That documentation is fine with me, but I'm not sure where the O_RDONLY / > O_PATH requirement comes from. Is there some code in the Linux kernel > (that I didn't find in a quick look at the execveat implementation) that > imposes that requirement? It's the deny_write_access call in do_open_execat in fs/exec.c. It returns an ETXTBSY error if the inode has been opened anywhere for writing, which is the case if the open flag is not O_RDONLY or O_PATH. (Admittedly, I relied on the manual page, but I've since verified this with a test case.)