Received: by 10.192.165.148 with SMTP id m20csp3424052imm; Mon, 23 Apr 2018 06:25:28 -0700 (PDT) X-Google-Smtp-Source: AIpwx49KiY33x8XYx8PdZ2LFPk8ROnPJEbq5NxFC2iJrXUa2QYw1Jg+Y8HXHgBOYNIx/d4zSNSJs X-Received: by 2002:a17:902:b709:: with SMTP id d9-v6mr20050471pls.188.1524489928820; Mon, 23 Apr 2018 06:25:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524489928; cv=none; d=google.com; s=arc-20160816; b=IHSxeKONSy9SbNyurOI8AJwCaR4sKOA9zRGYrmAqX2e4ATTcDdCB+0ptuBlhsmco/i GzBD4HcgaRgQS1ztSF9nNygM4Y+4tgjaH0atl76q5WvP7v1/xYuaeNscvA9nNScwoSG6 kbvmWbxE29lzd+0Olcp8jBn9BeWz2yvuU2Xa2AJVQWEdmLS/BarsQRiMZ9lfhHXnZmry dIcnRVXuUCxhzZDxjWw5UFLOzTs4h7dIJcje7CY6cYrLC85t4P706Xs2Rlvw6z6Jw+Vm BlN9ij76KA5xMoHWpMUZSpdOrEEEB+Sw04Z+w6hHzN8VKU6UFQC932qPh4v4pq/+Vl9U Mz9Q== 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:ironport-phdr :arc-authentication-results; bh=8br0aMw01TEUAF8ExhMsuHwOu3jXm9qRMjNwgPiRbrI=; b=0Ik5M6elyDqWC63hYbOhKb/HFdwS9sE7tepX2tYnetHL38JoxiwFiDNaidZLhdE2BE u5TDmEQZklHK70NMjeOmG822JH+EA4Hu7RcYIa9StjiQlu5TwSUmRTWd+VfIcfiCePtL ypCue6t7ysV1juA3R3a+aeaOf63+20eYVJgqsDoVcyyLcOx3YiKpvjY3YKJOKYor7ckJ 6oOhfAGGuGS5snTQOCm0+kFrwCUgaqqaQ6blOIMDaVO/2rFLkY8yQ2o/klwWhUO0ZSEg 3vrrNNw2fYKqAOJz1lu7lPO0XnM4INixWZ/pkP5i8hiIHwDrusdJFURD4e7ujwo3Difu 08tw== ARC-Authentication-Results: i=1; mx.google.com; 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 e6si8661330pgt.208.2018.04.23.06.25.14; Mon, 23 Apr 2018 06:25:28 -0700 (PDT) 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; 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 S1755226AbeDWNYE (ORCPT + 99 others); Mon, 23 Apr 2018 09:24:04 -0400 Received: from upbd19pa07.eemsg.mail.mil ([214.24.27.82]:13867 "EHLO upbd19pa07.eemsg.mail.mil" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754802AbeDWNYA (ORCPT ); Mon, 23 Apr 2018 09:24:00 -0400 Received: from emsm-gh1-uea11.ncsc.mil ([214.29.60.3]) by upbd19pa07.eemsg.mail.mil with ESMTP/TLS/AES256-SHA; 23 Apr 2018 13:23:55 +0000 X-IronPort-AV: E=Sophos;i="5.49,318,1520899200"; d="scan'208";a="12365612" IronPort-PHdr: =?us-ascii?q?9a23=3AHCQZ6x0xkWNkU5cMsmDT+DRfVm0co7zxezQtwd?= =?us-ascii?q?8ZsesVK/jxwZ3uMQTl6Ol3ixeRBMOHs6kC07KempujcFRI2YyGvnEGfc4EfD?= =?us-ascii?q?4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFA?= =?us-ascii?q?nhOgppPOT1HZPZg9iq2+yo9JDffwtFiCChbb9uMR67sRjfus4KjIV4N60/0A?= =?us-ascii?q?HJonxGe+RXwWNnO1eelAvi68mz4ZBu7T1et+ou+MBcX6r6eb84TaFDAzQ9L2?= =?us-ascii?q?81/szrugLdQgaJ+3ART38ZkhtMAwjC8RH6QpL8uTb0u+ZhxCWXO9D9QKsqUj?= =?us-ascii?q?q+8ahkVB7oiD8GNzEn9mHXltdwh79frB64uhBz35LYbISTOfVwZKPdec4RS3?= =?us-ascii?q?RHUMhfSidNBpqwY5UTA+YEO+tTsovzqEYUrRamGAeiGu3vxD9LiHH406I13O?= =?us-ascii?q?YuHh3J0gE7A9IDsm7ZoMnpOKocU+24yrTDwzXZb/NR3Dfw8JXGcgw/rvGUXb?= =?us-ascii?q?J/b8zRwlQyGQPAlFqQrYjlMC2V1+8QtGWb9PdvVfm0hm47qwB+vjivxsA2ho?= =?us-ascii?q?nPnYIa0ErI9Sp+wIYrPNC1TlNwb928EJZIqi2XOIR7TtkiTm11oio21LILtY?= =?us-ascii?q?ChcCQXzpks2gTRZOadc4eS5xLuTOORITBli317YL+/nBOy8VS4yu37S8m0zE?= =?us-ascii?q?5GripbndnIsXAAzwDT5dKdSvt840ehwiyD1xzT6+5YIUA0krDXK5g9zb4rip?= =?us-ascii?q?Ufq0HDHi7ymEnuja+WcFsr+vSw5uj6bbjrqYWQOo9phg3kLKgjldKzDf4lPg?= =?us-ascii?q?QWWmiU4+W81Lnt/U3jR7VKi+U7krLEv5DBPskbuq64DBNV0oYk8Rq/CSym38?= =?us-ascii?q?4CkXkIK1JFZgqLj5L1NFHWPPD4EfC/jkyxnzdrwPDHMKPuApHJLnjYi7rhZ6?= =?us-ascii?q?hy5FNcyAUp0dBT/Y5bCrYEIPjrQE/+qMTYDgMlMwyz2+vnEM9y1p4aWW+UGq?= =?us-ascii?q?+WKr7SsVuR6uIqJOmMY5UVtyjnJ/c54P7uiGczmUUBcqmxwZsXdH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ascii?q?gICJgICVwYBDAYCAQGCWIImDalhghyEWINlgi6BCYcDgQyBB4Eygjouh3OCN?= =?us-ascii?q?CACl3MIjjoGgTSDXYc9kVIzIYFSKwgCGAghDzuCQ4IgF44zIzBiAY9KAQE?= Received: from tarius.tycho.ncsc.mil ([144.51.242.1]) by emsm-gh1-uea11.NCSC.MIL with ESMTP; 23 Apr 2018 13:23:54 +0000 Received: from moss-pluto.infosec.tycho.ncsc.mil (moss-pluto [192.168.25.131]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id w3NDNnO6031536; Mon, 23 Apr 2018 09:23:50 -0400 Subject: Re: [PATCH 04/24] VFS: Add LSM hooks for filesystem context [ver #7] To: David Howells , Paul Moore Cc: viro@zeniv.linux.org.uk, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org, selinux@tycho.nsa.gov References: <152414466005.23902.12967974041384198114.stgit@warthog.procyon.org.uk> <152414469006.23902.8132059438921850399.stgit@warthog.procyon.org.uk> <3232.1524238511@warthog.procyon.org.uk> From: Stephen Smalley Message-ID: Date: Mon, 23 Apr 2018 09:25:09 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <3232.1524238511@warthog.procyon.org.uk> 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 04/20/2018 11:35 AM, David Howells wrote: > Paul Moore wrote: > >> Adding the SELinux mailing list to the CC line; in the future please >> include the SELinux mailing list on patches like this. It would also >> be very helpful to include "selinux" somewhere in the subject line >> when the patch is predominately SELinux related (much like you did for >> the other LSMs in this patchset). > > I should probably evict the SELinux bits into their own patch since the point > of this patch is the LSM hooks, not specifically SELinux's implementation > thereof. > >> I can't say I've digested all of this yet, but what SELinux testing >> have you done with this patchset? > > Using the fsopen()/fsmount() syscalls, these hooks will be made use of, say > for NFS (which I haven't included in this list). Even sys_mount() will make > use of them a bit, so just booting the system does that. > > Note that for SELinux these hooks don't change very much except how the > parameters are handled. It doesn't actually change the checks that are made - > at least, not yet. There are some additional syscalls under consideration > (such as the ability to pick a live mounted filesystem into a context) that > might require additional permits. Neither fsopen() nor fscontext_fs_write() appear to perform any kind of up-front permission checking (DAC or MAC), although some security hooks may be ultimately called to allocate structures, parse security options, etc. Is there a reason not apply a may_mount() or similar check up front?