Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp938572imu; Thu, 13 Dec 2018 06:58:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/XJDp/2mLW7IZKULOFrc4GExo4NQ4tyq2bUoq9kU2TXSPj971bX4Dm9lQ37N4RBEnJfb+r9 X-Received: by 2002:a17:902:6113:: with SMTP id t19mr23075027plj.248.1544713096786; Thu, 13 Dec 2018 06:58:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544713096; cv=none; d=google.com; s=arc-20160816; b=PwTVHDruZ6CqebCU5UPXS3bzY4oECmasY1J4DSFSEI3lkOJdJbSufUbdylYl4dyQB0 JwqusqXpj/BB/EkG4CjbZ/NVc4HXd91tYXRBfzEGDRHHnbiN7/HoTXtYJRkYx6N/6rrf 8cF0ttGb+IsLZrwsx960QBZCvqboQAOqj/LLeE+vZNCqWLpuf7CXYKoxcsmbN2oAdPOA ThTzuNrG/hjh35yQdbSbwSxWUOXdZf0cdv9cSe3YmhJYO6Tkqa7ET1k6zjLkqtTbvPdL +7sY2L93zWR6sDfwGfvCR6mO8AsNgb+JFokJhaRruSkiK3AIVKwoA/iWPBFS9JxP87LR j5tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=XQuJLCKd8NgyTPpZSDB31xU4v89NC3a6DqdOsKQTQzA=; b=pq+j1eF/G+yDHPX9vPToqqBQxm+mRALvbxh3v1sg1RnVtcbzW8lnu1beYQO/5xjySC EJrJlBATtxmEnyDSUCWXnnPZ7yUtR2gWzM59IAc3UK803FrDrPU5a3w9Kbo3758lg2O1 vC+CONyIY/OFTjwQwtCNgDCcWuFn0ganbpswS6L6h7SPIre8iZQqVNo+1taZ9Hrklboo KeMHB0kmlH0lf9TJVasaT7HE1rr2F1tub1EV5svjOYt56DfJGAnAigLb1mRInU38/ptF ++ldHqUJoRf4+HLcc+m70O2HqKSNs+Uk5bOvXQYVxxQADjJ25Maqbm6tbG57I0ERr2pS /brg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ssi.gouv.fr header.s=20160407 header.b=R1LLWeuF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r197si1936191pfr.192.2018.12.13.06.57.59; Thu, 13 Dec 2018 06:58:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ssi.gouv.fr header.s=20160407 header.b=R1LLWeuF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729154AbeLMO5L (ORCPT + 99 others); Thu, 13 Dec 2018 09:57:11 -0500 Received: from smtp-out.ssi.gouv.fr ([86.65.182.90]:54644 "EHLO smtp-out.ssi.gouv.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727618AbeLMO5L (ORCPT ); Thu, 13 Dec 2018 09:57:11 -0500 Received: from smtp-out.ssi.gouv.fr (localhost [127.0.0.1]) by smtp-out.ssi.gouv.fr (Postfix) with ESMTP id 2B833D0006B; Thu, 13 Dec 2018 15:57:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ssi.gouv.fr; s=20160407; t=1544713037; bh=hmviYkZAUzSSN4VTzvQLUSCMhOsq6DYKpUiHzI6rReA=; h=Subject:To:CC:References:From:Date:In-Reply-To:From:Subject; b=R1LLWeuFQXYicPyde+2L/5l1lnaFYwDfgRmEBw3E9WCmmCD6EgbN+Z6ZzJO73skY/ WDLTEhYl0+oC3tiRw9wkRp4Web7BQeev58BsJpf+2Sz9/rWiuTl6ArElznFhvALliz k8WToO2CpmKORRXoZpFPemas/nO9etlNaSKND0yE76qsYk2tuyvgclN/h5x7PGqBVj jjlI7zoFsB1oMVgHUKPn74Vd2NhvkLTpX7hTekaIOBQdwcgLuyWRtb+gq+QcYQffg9 DeDbusb/qwDu9nx18FzQAERzupwa9lp3FE/j3uZeDH/QZLSquDUh/HrBDfeA03E9/j tcixwdWCiP4cQ== Subject: Re: [RFC PATCH v1 0/5] Add support for O_MAYEXEC To: Florian Weimer , James Morris CC: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= , , Al Viro , Jonathan Corbet , Kees Cook , Matthew Garrett , Michael Kerrisk , Mimi Zohar , =?UTF-8?Q?Philippe_Tr=c3=a9buchet?= , Shuah Khan , Thibaut Sautereau , Vincent Strubel , Yves-Alexis Perez , , , , References: <20181212081712.32347-1-mic@digikod.net> <87lg4upkpv.fsf@oldenburg2.str.redhat.com> <87ftv2ovp8.fsf@oldenburg2.str.redhat.com> From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= Message-ID: <21824ed9-0fe4-85dd-bdd2-d4426e97233d@ssi.gouv.fr> Date: Thu, 13 Dec 2018 15:57:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <87ftv2ovp8.fsf@oldenburg2.str.redhat.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/12/2018 06:13, Florian Weimer wrote: > * James Morris: > >> On Wed, 12 Dec 2018, Florian Weimer wrote: >> >>> * James Morris: >>> >>>> If you're depending on the script interpreter to flag that the user may >>>> execute code, this seems to be equivalent in security terms to depending >>>> on the user. e.g. what if the user uses ptrace and clears O_MAYEXEC? This security mechanism makes sense in an hardened system where the user is not allowed to import and execute new file (write xor execute policy). This can be enforced with appropriate mount points a more advanced access control policy. >>> >>> The argument I've heard is this: Using ptrace (and adding the +x >>> attribute) are auditable events. >> >> I guess you could also preload a modified libc which strips the flag. > > My understanding is that this new libc would have to come somewhere, and > making it executable would be an auditable even as well. Auditing is a possible use case as well, but the W^X idea is to deny use of libraries which are not in an executable mount point, i.e. only execute trusted code.