From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754013AbeARVZW (ORCPT ); Thu, 18 Jan 2018 16:25:22 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:40174 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753390AbeARVZN (ORCPT ); Thu, 18 Jan 2018 16:25:13 -0500 Subject: Re: [RFC PATCH v2] ima,fuse: introduce new fs flag FS_NO_IMA_CACHE From: Mimi Zohar To: Alban Crequy , Alban Crequy Cc: iago@kinvolk.io, dongsu@kinvolk.io, linux-kernel@vger.kernel.org, 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 Date: Thu, 18 Jan 2018 16:25:02 -0500 In-Reply-To: <20180116151000.443-1-alban@kinvolk.io> References: <20180116151000.443-1-alban@kinvolk.io> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 18011821-0012-0000-0000-000005A5543D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18011821-0013-0000-0000-00001920D075 Message-Id: <1516310702.3772.11.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-18_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801180279 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.  I'm also wondering if this change should be separated from the IMA change. Mimi