Received: by 10.223.176.46 with SMTP id f43csp2670801wra; Mon, 22 Jan 2018 01:16:53 -0800 (PST) X-Google-Smtp-Source: AH8x227lyppd8CDMkjG2laM2SmB2MubNNOtOOFiQhBipPPuLtw8EgxdKwl0sqtiqxnz+pl3IsobY X-Received: by 2002:a17:902:6115:: with SMTP id t21-v6mr3146726plj.322.1516612613461; Mon, 22 Jan 2018 01:16:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516612613; cv=none; d=google.com; s=arc-20160816; b=qt4tTRNaXbPp7b9EIC4qE3iT1kyDiZS/ArgDUNvV2pQgu40tSlwwiCnVdQoT3+Cj3+ uLtqovysSc4vQtK2yS8B1XUXHlciLMv40AlkWtCL575x75Xp2TldwsNc0U/9LuIJtgkC Te9Q0H5BAiQFVI2ZE0emvcRscBsy2JB9DDqVIfMqtCKF2d07kLcGCrxM1MyKmcKVmzQ1 g8dAZnwGsCATZVX1tSbSR7GKpIULpFUDK5b0jXigm6bWgg5SRqJ6XyFNq3BwUdj+5V2+ WFg9SRAoWBV0omm+j1lHOEPdcrcLrgzlHAk7Vg0QrSmf+gSdgj85Tz7i6AmrVNbjyJHP FWvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=pCOaXXPajovm4Nf2IK6dmhsgXkpQ23+7fKmIgnlSo/Q=; b=ujIEZJeDAG3Y//mFm74BYniEPcSiurU3a4ugAi+4DEZUGHW93TzscJiHhLFTCDOb/D snSNsIEN4kXMiNsTLNnp2dBBVzxZgQsPsfHM+y9H0G7kAhK29p74GXBLRrM0PO5KwVgL EqgF2mo3ySVSwFoo2RnoPJbMwdbEr/h6hhMKOWbsXHs8LupXl5dJc4apfW6l04WkuYoV L/en4v4xBRtA05mAFigtIM0wPU1/Y+ebi+XfQB6R9uA+9HFBVXRYQNpATAwxO+u0wjVY OBqx8CV4jwFlOyOEjM2GYUyj1kMCrOKivVIVjGkXAKSzbj4BX1xONr2kCyF0WHC8mAWC 1G2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kinvolk.io header.s=google header.b=d7p0jpuA; 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 p6si10784592pga.651.2018.01.22.01.16.39; Mon, 22 Jan 2018 01:16:53 -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=@kinvolk.io header.s=google header.b=d7p0jpuA; 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 S1752656AbeAVJQN (ORCPT + 99 others); Mon, 22 Jan 2018 04:16:13 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:43351 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751351AbeAVJQJ (ORCPT ); Mon, 22 Jan 2018 04:16:09 -0500 Received: by mail-pf0-f196.google.com with SMTP id y26so6602409pfi.10 for ; Mon, 22 Jan 2018 01:16:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kinvolk.io; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pCOaXXPajovm4Nf2IK6dmhsgXkpQ23+7fKmIgnlSo/Q=; b=d7p0jpuAQOf9fHmqfCCnUhMhWuPxcySGtubFUrdbU8PuUbFk56zRjFxxAaZYQ5w/14 POKF2CPnDHSfqo8iOROeJ8f/x1yw+taPXCCLCVps8VYDcqKvel8r+/ShZwVnIeo/ahtT IuDzKSP6FdSswd0qFItF5Hj3KE7GC78QLY9hc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=pCOaXXPajovm4Nf2IK6dmhsgXkpQ23+7fKmIgnlSo/Q=; b=uYsyb8VPQ7joQ5707PY23+LqtmnCKPOi6V/SkUB+3FGIN19Z0iU60v87shQpIimDFL eAP9uP7WMGBz51ss2gjXxiBrFFymblr2jxC1gfT/CVnghpMik8VyFfXpWWoOfdWhIrJd 0z56JWMRD+HhRgFXHkW4U5V41H1Muabh5YUFVTIjAJBX0xYMhfw+mjT5cyFlzx//SIRE iP0JGKyPtZaA9+EUVD8bDb0ForTZ0JdcaYdakKkJYjaqodJkQVDNsLIkhmU9tPSzgJAO ykbTM2ihGoceJ76/9C6Rkmz5Kxvu4Y+UJxtncU9E0YPr6EzYln6rIIrH7YGERnD1I61A 7h3w== X-Gm-Message-State: AKwxytd0YVldktsF2Gm1fVZKJ76H73ZwgqoMjY95xqQyR6xQKjkz4I0z P8JPEXuAmscQqgv/bnhRt2rzYDDnWsRg763E8meyzQ== X-Received: by 2002:a17:902:2843:: with SMTP id e61-v6mr772492plb.260.1516612568073; Mon, 22 Jan 2018 01:16:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.100.162.110 with HTTP; Mon, 22 Jan 2018 01:16:07 -0800 (PST) In-Reply-To: <1516380970.3772.112.camel@linux.vnet.ibm.com> References: <20180116151000.443-1-alban@kinvolk.io> <1516310702.3772.11.camel@linux.vnet.ibm.com> <1516380970.3772.112.camel@linux.vnet.ibm.com> From: Alban Crequy Date: Mon, 22 Jan 2018 10:16:07 +0100 Message-ID: Subject: Re: [RFC PATCH v2] ima,fuse: introduce new fs flag FS_NO_IMA_CACHE To: Mimi Zohar Cc: Alban Crequy , =?UTF-8?Q?Iago_L=C3=B3pez_Galeiras?= , Dongsu Park , LKML , linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, Miklos Szeredi , Alexander Viro , Dmitry Kasatkin , James Morris , "Serge E. Hallyn" , Seth Forshee , Christoph Hellwig Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 19, 2018 at 5:56 PM, Mimi Zohar wrote: > On Fri, 2018-01-19 at 11:35 +0100, Alban Crequy wrote: >> On Thu, Jan 18, 2018 at 10:25 PM, Mimi Zohar wrote: >> > On Tue, 2018-01-16 at 16:10 +0100, Alban Crequy wrote: >> >> From: Alban Crequy >> >> >> >> This patch forces files to be re-measured, re-appraised and re-audited >> >> on file systems with the feature flag FS_NO_IMA_CACHE. In that way, >> >> cached integrity results won't be used. >> >> >> >> For now, this patch adds the new flag only FUSE filesystems. This is >> >> needed because the userspace FUSE process can change the underlying >> >> files at any time. >> > >> > Thanks, it's working nicely. >> > >> > >> >> diff --git a/include/linux/fs.h b/include/linux/fs.h >> >> index 511fbaabf624..2bd7e73ebc2a 100644 >> >> --- a/include/linux/fs.h >> >> +++ b/include/linux/fs.h >> >> @@ -2075,6 +2075,7 @@ struct file_system_type { >> >> #define FS_BINARY_MOUNTDATA 2 >> >> #define FS_HAS_SUBTYPE 4 >> >> #define FS_USERNS_MOUNT 8 /* Can be mounted by userns root */ >> >> +#define FS_NO_IMA_CACHE 16 /* Force IMA to re-measure, re-appraise, re-audit files */ >> >> #define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() during rename() internally. */ >> >> struct dentry *(*mount) (struct file_system_type *, int, >> >> const char *, void *); >> >> >> > >> > Since IMA is going to need another flag, we probably should have a >> > consistent prefix (eg. "FS_IMA"). Maybe rename this flag to >> > FS_IMA_NO_CACHE. >> >> Ok, I can rename it. >> >> Is there a discussion about the other IMA flag? > > There's not a single thread that I can point to, but more of an on > going discussion as to what it means for a filesystem to support IMA > and how that decision is made. > > - Initial measuring, verifying, auditing files > - Safely detecting when a file changes > - Not applicable/supported > > With Sascha Hauer's patch "ima: Use i_version only when filesystem > supports it" and this patch, the second issue is addressed, but will > cause files to be re-validated, perhaps unnecessarily, impacting > performance. > > Some filesystems should not be evaluated, such as pseudo filesystems > (eg. cgroups, sysfs, devpts, pstorefs, efivarfs, debugfs, selinux, > smack). Instead of defining a flag indicating whether or not IMA is > applicable/supported, we should define a new flag, indicating whether > it is a pseudo filesystem. This would eliminate a large portion of at > least the builtin IMA policy rules. Thanks for the explanation. If that other flag is about whether it is a pseudo filesystem, it might not have "IMA" in the name though. >> > I'm also wondering if this change should be >> > separated from the IMA change. >> >> Do you mean one patch for adding the flag and the IMA change and >> another patch for using the flag in FUSE? > > The flag and FUSE usage of the flag, separately from IMA. Ok, I will send a v3 with the 2 changes. Alban