Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp600394pxa; Tue, 11 Aug 2020 10:19:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLWn4Ec+rkn3uwPRcILvmPxcRglwVKnfTAsOnkLCr2gidAPfSKHw2RezDal7rXOwk1uxD6 X-Received: by 2002:a17:906:cb0a:: with SMTP id lk10mr11192685ejb.209.1597166352494; Tue, 11 Aug 2020 10:19:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597166352; cv=none; d=google.com; s=arc-20160816; b=Xx8CUDBpFWCHiRaJ9+/vxFl9mCXti8h8zL+OoDZZuWGq/esrZ8h5T5fiqZioWTNBoQ ksJFN2E0ZhnKzWJUGgQ0k9PK7O23tOv58hoM8jFS1yKWK7iaQ5uXm3cKNCV+xelBAAbx fVqb996GPTJFbG1Ses2kpDIkI5coY7PIwTtl/pjNzZjimoWINeREYz0/mBYg4gacGLDr lLz7xa4hG0+NCVxBvlgLh+pKNJvSS5ZAI6iCKHA3W555K02Mzne05MDmDFQuahNaQAWr Q5S0a8A6Qw+nyIehBxCAOxVwwfIec95o5Lzfh0BmS3vRpL5PzWpXbt50lgHq6UjXuhv+ 3T1Q== 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:dkim-filter; bh=4CUNuNiiePWf1WTPIiwYBL13LZ+7k2/9/J/jpcaXW7A=; b=C18RpabFIhpYSQiGQDjqB/8hn7dCNMKM8TY7d+y0u1+hICBolfmkcCUFpOr6AVcabx wGWKwBSz2dsvBTngM3yqEbADha4fdz+58mm+Xcf7h19zEJH8vetf4GeSE/vpKtaKK/Jx OG0337SzvMHUp5cfwnxB5Fd6IuefQhGz/GV2zmMIMxEff6QKiGXSOB9DDpxqaSKDG4c5 qU0fDZkG8Z0l5FsybRC59bOSaOCHYyJpmuDSiOLB5W800gnDtDrJWZ+Z8YASBupV8h/J gxBpxfAA1qWsQMibwHrWQ0dg1TqxKftAxJfRZb93nnPpi/TuJbGr7//fDtxKm63miMYN UOlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=PoJFWvdJ; 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=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b23si12550178edy.72.2020.08.11.10.18.49; Tue, 11 Aug 2020 10:19:12 -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=@linux.microsoft.com header.s=default header.b=PoJFWvdJ; 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=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729186AbgHKRSM (ORCPT + 99 others); Tue, 11 Aug 2020 13:18:12 -0400 Received: from linux.microsoft.com ([13.77.154.182]:56798 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728990AbgHKRSK (ORCPT ); Tue, 11 Aug 2020 13:18:10 -0400 Received: from [10.137.106.139] (unknown [131.107.174.11]) by linux.microsoft.com (Postfix) with ESMTPSA id 364D420B4908; Tue, 11 Aug 2020 10:18:09 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 364D420B4908 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1597166289; bh=4CUNuNiiePWf1WTPIiwYBL13LZ+7k2/9/J/jpcaXW7A=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=PoJFWvdJ1RO9aetIAjmD0rk7oHcgoNUd11mJAo6cf98zwa1+fMROHW9q/uMp6iMeX Gx9jAgsZekiKh7pxAVZrnSCW536fsoku8TARzOm+dS5qqA/BlR8Bpa7J8vLGhpHHRD Yi+yCyW66KZsN6+KFh8r2FianF/MQzdF5N+1bL7A= Subject: Re: [PATCH v7 0/7] Add support for O_MAYEXEC To: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= , Jann Horn , Kees Cook , Mimi Zohar Cc: Al Viro , Andrew Morton , kernel list , Aleksa Sarai , Alexei Starovoitov , Andy Lutomirski , Christian Brauner , Christian Heimes , Daniel Borkmann , Dmitry Vyukov , Eric Biggers , Eric Chiang , Florian Weimer , James Morris , Jan Kara , Jonathan Corbet , Lakshmi Ramasubramanian , Matthew Garrett , Matthew Wilcox , Michael Kerrisk , =?UTF-8?Q?Philippe_Tr=c3=a9buchet?= , Scott Shell , Sean Christopherson , Shuah Khan , Steve Dower , Steve Grubb , Tetsuo Handa , Thibaut Sautereau , Vincent Strubel , Kernel Hardening , Linux API , linux-integrity@vger.kernel.org, linux-security-module , linux-fsdevel References: <20200723171227.446711-1-mic@digikod.net> <202007241205.751EBE7@keescook> <0733fbed-cc73-027b-13c7-c368c2d67fb3@digikod.net> <20200810202123.GC1236603@ZenIV.linux.org.uk> <917bb071-8b1a-3ba4-dc16-f8d7b4cc849f@digikod.net> <0cc94c91-afd3-27cd-b831-8ea16ca8ca93@digikod.net> From: Deven Bowers Message-ID: <77d685ec-aba2-6a2c-5d25-1172279ceb83@linux.microsoft.com> Date: Tue, 11 Aug 2020 10:18:08 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <0cc94c91-afd3-27cd-b831-8ea16ca8ca93@digikod.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/11/2020 1:48 AM, Mickaël Salaün wrote: [...snip] >>> It is a >>> good practice to check as soon as possible such properties, and it may >>> enables to avoid (user space) time-of-check to time-of-use (TOCTOU) >>> attacks (i.e. misuse of already open resources). >> >> The assumption that security checks should happen as early as possible >> can actually cause security problems. For example, because seccomp was >> designed to do its checks as early as possible, including before >> ptrace, we had an issue for a long time where the ptrace API could be >> abused to bypass seccomp filters. >> >> Please don't decide that a check must be ordered first _just_ because >> it is a security check. While that can be good for limiting attack >> surface, it can also create issues when the idea is applied too >> broadly. > > I'd be interested with such security issue examples. > > I hope that delaying checks will not be an issue for mechanisms such as > IMA or IPE: > https://lore.kernel.org/lkml/1544699060.6703.11.camel@linux.ibm.com/ > > Any though Mimi, Deven, Chrome OS folks? > I don't see an issue with IPE. As long as the hypothetical new syscall and associated security hook have the file struct available in the hook, it should integrate fairly easily. [...snip]