From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id E0FB3385DC32 for ; Tue, 28 Apr 2020 17:19:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E0FB3385DC32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=joseph_myers@mentor.com IronPort-SDR: 8DTRm5pF3g5ev15dQlBxCGbm1Lkd3YYDZK830WlGD5+whPmvIHlF/vNlLDbYYpLevhZUORnm4l DkAfsOzDuJG7Vjnpz4vYzQkuqJJAMN8gBcbp+UbEeIVhQqYLP6v8/f7r4u4pLCbEW61OQ0YQSY KVLwa7fbIXxzjn/2q/tSl4C4NuHZmbMVrVpHukShXqbPZx3o2bJdBHVi83u893uM7C37GEvJyL rHIvB+MOwmNroH+w+EkwhqUpKTXUd1bCRPUywNn+uw1AjACwbYuLG4Na4CjmEKy/9RUhVhNMYa mP4= X-IronPort-AV: E=Sophos;i="5.73,328,1583222400"; d="scan'208";a="50327949" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 28 Apr 2020 09:19:26 -0800 IronPort-SDR: K3lZXCiLR8iGcLpzglzbBqDh1Dd4soFkylsMFa/0gYCXxDTLHradFzY95i7sLgV2l5gZx7qUZw FfiwRwBlnfcZJzGuafIdj+qDSc5+tsVg+p0gCKspcfiiJD118n3CV8luRnopx5Q1Ay2FJmU2a0 Sbkr7RmgEU5YvBPWAUw+nxO663qL7/MMEWSx+Evueg5bICu0YqA6lipN28HiDZTgRIhQttg3g7 /5w5nwegPSREL8gDGl9n9bE9L++9Hb22L5D240PIgPaOXc03mEPLdmq4L06f45X7MwvQcFemGm grE= Date: Tue, 28 Apr 2020 17:19:21 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Florian Weimer CC: , =?ISO-8859-15?Q?Alexandra_H=E1jkov=E1?= Subject: Re: [PATCH] Linux: Add execveat system call wrapper In-Reply-To: <87blnbo7ka.fsf@mid.deneb.enyo.de> Message-ID: References: <20200428122019.26826-1-ahajkova@redhat.com> <87v9ljodfl.fsf@mid.deneb.enyo.de> <87blnbo7ka.fsf@mid.deneb.enyo.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Tue, 28 Apr 2020 17:19:38 -0000 On Tue, 28 Apr 2020, Florian Weimer wrote: > >> > > > > 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. Thanks. The patch is OK. -- Joseph S. Myers joseph@codesourcery.com