Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp718867ybz; Fri, 1 May 2020 07:20:24 -0700 (PDT) X-Google-Smtp-Source: APiQypLKVyb6kKKx4POwcedORDvvdzdBSyJhEfNxlm/7dCJdu5l0VmsAGYCK9DZxM3PlngSM6S2w X-Received: by 2002:a50:d744:: with SMTP id i4mr3615154edj.176.1588342824197; Fri, 01 May 2020 07:20:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588342824; cv=none; d=google.com; s=arc-20160816; b=tpDRHgz76LB9ep9KoVvU0esHYzxmKbx9E5TW8LtSS5qA35peU9N60bl22bH3b3o13r FbzJSJewd7G3Tz1L90hEi1njPaHf/X/xmyIODWHoIwtL4HVTbmpbZjIxOM20MhbLb2C8 Fk2QDLNwzHFXbOcZ/2UqXalZPouHThuL44zU/YpMtRIfhO5yoIfqULr97Xex2BjGK2Sp 3sdblYrApTikM7IR8jp5aZqatogp1lN2Gsi4oDjdUS1Sx2kJcrrecdkkzdzpttm7HkOt 4B2WQlHFD7ZblofI40WLiOCarOAWTw4Zy6nCVxA2x4OHtr2mY+soh0PP0VBBg+TjyS+f fk7g== 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; bh=1qj/LZY1X9gsESDlGWFp+c5FB+OotoqYpsGQ4uhzf/g=; b=ALjzoUblqQ0Q8osty6Pog5HzTp/ZhnABvajb2WY2AA3DZhHTagYcta/t7mogQCs6Yv QPQ5EvuT3LjMfE1jhfBFBhDXT7Lqlgg/ZHjqZwgoBqAcCQYrM9B5robdTLcReAaGCsvM X9D1GsolrbNRoiMthhsFKU/yzi62i9qhmOZDOS8dHwfQdE5mCGjVDkLBmtS5cDinaSjm bdniBWQ1pq5gsAtACpctuGOrdK9G32newaloYNTyqQYcexY/WuXnCts9gX3/lmAHnaF+ Yj4EW1pti340nxAKY/tm7es0GPBOu0HlLSHwaihLGQGcwW9c93XK58diCzxHBTK/aJyF /Dng== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c23si1692912edy.407.2020.05.01.07.20.01; Fri, 01 May 2020 07:20:24 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729455AbgEAOSD (ORCPT + 99 others); Fri, 1 May 2020 10:18:03 -0400 Received: from smtp-190c.mail.infomaniak.ch ([185.125.25.12]:50817 "EHLO smtp-190c.mail.infomaniak.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729038AbgEAOSD (ORCPT ); Fri, 1 May 2020 10:18:03 -0400 Received: from smtp-2-0001.mail.infomaniak.ch (unknown [10.5.36.108]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 49DDqS3rYhzlhNh9; Fri, 1 May 2020 16:17:56 +0200 (CEST) Received: from ns3096276.ip-94-23-54.eu (unknown [94.23.54.103]) by smtp-2-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 49DDqR24jbzlrVLQ; Fri, 1 May 2020 16:17:55 +0200 (CEST) Subject: Re: [PATCH v3 2/5] fs: Add a MAY_EXECMOUNT flag to infer the noexec mount property To: James Morris Cc: linux-kernel@vger.kernel.org, Aleksa Sarai , Alexei Starovoitov , Al Viro , Andy Lutomirski , Christian Heimes , Daniel Borkmann , Deven Bowers , Eric Chiang , Florian Weimer , Jan Kara , Jann Horn , Jonathan Corbet , Kees Cook , Matthew Garrett , Matthew Wilcox , Michael Kerrisk , =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= , Mimi Zohar , =?UTF-8?Q?Philippe_Tr=c3=a9buchet?= , Scott Shell , Sean Christopherson , Shuah Khan , Steve Dower , Steve Grubb , Thibaut Sautereau , Vincent Strubel , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org References: <20200428175129.634352-1-mic@digikod.net> <20200428175129.634352-3-mic@digikod.net> From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= Message-ID: Date: Fri, 1 May 2020 16:17:54 +0200 User-Agent: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Antivirus: Dr.Web (R) for Unix mail servers drweb plugin ver.6.0.2.8 X-Antivirus-Code: 0x100000 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/05/2020 06:02, James Morris wrote: > On Tue, 28 Apr 2020, Micka?l Sala?n wrote: > >> An LSM doesn't get path information related to an access request to open >> an inode. This new (internal) MAY_EXECMOUNT flag enables an LSM to >> check if the underlying mount point of an inode is marked as executable. >> This is useful to implement a security policy taking advantage of the >> noexec mount option. >> >> This flag is set according to path_noexec(), which checks if a mount >> point is mounted with MNT_NOEXEC or if the underlying superblock is >> SB_I_NOEXEC. >> >> Signed-off-by: Micka?l Sala?n >> Reviewed-by: Philippe Tr?buchet >> Reviewed-by: Thibaut Sautereau >> Cc: Aleksa Sarai >> Cc: Al Viro >> Cc: Kees Cook > > Are there any existing LSMs which plan to use this aspect? This commit message was initially for the first version of O_MAYEXEC, which extended Yama. The current enforcement implementation is now directly in the FS subsystem (as requested by Kees Cook). However, this MAY_EXECMOUNT flag is still used by the current FS implementation and it could still be useful for LSMs.