Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp331098ybk; Fri, 15 May 2020 01:45:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2stDtTRpvA5qwrFDCwr9cFp2BGvMWUtKpC8qQsmneww/oLGQjCbaZ19OxiVsko/DaAy7I X-Received: by 2002:a17:907:2054:: with SMTP id pg20mr1621085ejb.127.1589532350410; Fri, 15 May 2020 01:45:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589532350; cv=none; d=google.com; s=arc-20160816; b=rxV10ykQPg/NL0zkgYkF+n8D5Jsus3JuGUUDRTDLlnCz4PtpEf6Gqax4X6VmSKugu8 t3KPyc1yeu/Xh5U9ykyfevByCzE9v/hinOCKhDTT0Ky9rD7OLNwzqf9WLKNdiwlOBUCx cGNvXx1kdJkTQb+viO1FCGyN7YApVQNfAdWSJZbKvg2N3jPWoItXnjdK4ZzK8qaEJj83 Ago7HBcBvJmaf0bT8NZhPZXbIX/HXgPfhdnIkDh8uyZtdU8/NPz5xAC9FE5KoL0MTK88 TbDG2gkddbINodYFgwTE3kS1Anx2zQP2Qev4Y3WQMXUiHB1T9aAg+/3RZVf/hV2+nuZl nRlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:dkim-signature; bh=+98viFOd9jTdpHCY3sUvt3t0b4J5Yg6795DHu7DfVIk=; b=o8pWqJkN768nwzyWR6gC2nHZzsct78X1L7Nafpw828ezxAJ7oDM3u8FFdpUHD7Nyw8 Y9lUPSxlyT8eOXZDF5KOKQIpq86EnzatFMrxRVViRxuK8L/KaNYuIbzF2cw/MWnTmlI1 dROdQsJOLN2sukPHgArHj3qFYnLsEeYmyPyrQbqnv/VcJmuVn4PmbFRPaINIhGG/tbg8 6XJspkrr0m7jsU86DhVO7H1FdoRSxD4IMUUbY8lStOF0XDqc8jDvnK68bnedPpc16hen W03H8Y8Liu6Q+PLcwrcNIcGQzRYT0+XwES1+DDH27Bww/CTH08NzNk2sr1/NFlJ7sXiT kBnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fKScrmok; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a26si711949edr.356.2020.05.15.01.45.25; Fri, 15 May 2020 01:45:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fKScrmok; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727927AbgEOInz (ORCPT + 99 others); Fri, 15 May 2020 04:43:55 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:33564 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727796AbgEOInz (ORCPT ); Fri, 15 May 2020 04:43:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589532233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+98viFOd9jTdpHCY3sUvt3t0b4J5Yg6795DHu7DfVIk=; b=fKScrmokPCuiEv3RuFPvqUqtSW4pRmkmMSR+m4lh38ZgD+He292FGbDa0d1vO+m+zQM/FS hZS2ZoMIm6vpaQmRVG+WTcp5H2ZGUlT6LGY28+K/tGKndmvV9ym5GKCV4EXnuQEpX8Wv68 TnnOhRJ7AnJGXiPknOKzEniP49FHPNI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-164-u_nUq3bSN8OR1tg-mmpQdg-1; Fri, 15 May 2020 04:43:49 -0400 X-MC-Unique: u_nUq3bSN8OR1tg-mmpQdg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C8CC9801503; Fri, 15 May 2020 08:43:44 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-112-77.ams2.redhat.com [10.36.112.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6435B5D9D7; Fri, 15 May 2020 08:43:36 +0000 (UTC) From: Florian Weimer To: Kees Cook Cc: =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= , Al Viro , Aleksa Sarai , Andy Lutomirski , Mimi Zohar , Stephen Smalley , Christian Heimes , Deven Bowers , Tetsuo Handa , John Johansen , Kentaro Takeda , "Lev R. Oshvang ." , Alexei Starovoitov , Daniel Borkmann , Eric Chiang , James Morris , Jan Kara , Jann Horn , Jonathan Corbet , Lakshmi Ramasubramanian , Matthew Garrett , Matthew Wilcox , Michael Kerrisk , =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= , Philippe =?utf-8?Q?Tr=C3=A9buchet?= , Scott Shell , Sean Christopherson , Shuah Khan , Steve Dower , Steve Grubb , Thibaut Sautereau , Vincent Strubel , linux-kernel , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-integrity@vger.kernel.org, LSM List , Linux FS Devel Subject: Re: How about just O_EXEC? (was Re: [PATCH v5 3/6] fs: Enable to enforce noexec mounts or file exec through O_MAYEXEC) References: <20200505153156.925111-1-mic@digikod.net> <20200505153156.925111-4-mic@digikod.net> <202005131525.D08BFB3@keescook> <202005132002.91B8B63@keescook> <202005140830.2475344F86@keescook> <202005142343.D580850@keescook> Date: Fri, 15 May 2020 10:43:34 +0200 In-Reply-To: <202005142343.D580850@keescook> (Kees Cook's message of "Fri, 15 May 2020 01:01:32 -0700") Message-ID: <87a729wpu1.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Kees Cook: > Maybe I've missed some earlier discussion that ruled this out, but I > couldn't find it: let's just add O_EXEC and be done with it. It actually > makes the execve() path more like openat2() and is much cleaner after > a little refactoring. Here are the results, though I haven't emailed it > yet since I still want to do some more testing: > https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/log/?h=kspp/o_exec/v1 I think POSIX specifies O_EXEC in such a way that it does not confer read permissions. This seems incompatible with what we are trying to achieve here. Thanks, Florian