Received: by 10.223.176.46 with SMTP id f43csp3101669wra; Mon, 22 Jan 2018 08:26:07 -0800 (PST) X-Google-Smtp-Source: AH8x227h0rPUjWh69ufgTPmJv+bE7BYDgKVxAhSriWG9iV6LYJCZpER5yieoVpPUPPiCN+e39Sk+ X-Received: by 10.107.142.202 with SMTP id q193mr9276132iod.100.1516638367200; Mon, 22 Jan 2018 08:26:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516638367; cv=none; d=google.com; s=arc-20160816; b=wyWGZz08NRBbXKU9mfc+AuwieEEe09pHTuwKhZfFN3anfMyJDt5kEZg8yf7ox8njP0 Ipc1AE83ATC8rKzUR04rISYie8IEzZqv7pRpN3xMFb+Ktb6r+8OFyAoPIy2ppsiWpfOX 8WeTsAllpBBlwuOhsg87s+TfKX3QU2XzffNq94naWQuQMlQT0L8T4pTS3/SpKMaezq8N PUuHvXHa4z4EHUyrl1VRaZw4WqKmmTJacTqg0XWLAemY1U0rlNXdX8EUV64l2mypMOG1 NnXZaG5Ewzq5AoWa9fdEe2BdTvrGWn/EHucFGergPkKXkGsJoxDYVNI5hd94ZRgFLwqN I8uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=JUfV9va6RmWp8BK7LQaxTCfU3OKTt96bTzHFUZvMO7w=; b=v2vw2e3/b8z7P/d0Gx5dbGi3HDUAMkKMcttOnis+5Hdnw4B9XqV83mmTEfiIl3FWlX wThZcFiwX+2gA+AcLF8gCsNo2o6n3p3AAC6Y9pX+Ec8hGxL+1pEFK0ZsYXDTY1+83IWJ bFxRyXYUAfO3XSITCuyokpy1fd5f7R9TzJa1Tw4t/Pt5J9/SajzS1xb7XpHUiI8z3I8I bZWZW6PXJlK7rJltGxQbAqwyffQnmi8Hsy+/UAuebYMLZLCxpKlNhpOnGemaefC5bh7h hJJxTUb++wMXo6yJflFxMlWv0RFfIdK4rrdmLfQ5S8dJJNZsxCDVelNcR63Dn4iDTqpp djUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=R6RMOatD; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 65si3712366iov.230.2018.01.22.08.25.53; Mon, 22 Jan 2018 08:26:07 -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=fail header.i=@gmail.com header.s=20161025 header.b=R6RMOatD; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751195AbeAVQZX (ORCPT + 99 others); Mon, 22 Jan 2018 11:25:23 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:41705 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751087AbeAVQZV (ORCPT ); Mon, 22 Jan 2018 11:25:21 -0500 Received: by mail-wm0-f68.google.com with SMTP id f71so17420094wmf.0; Mon, 22 Jan 2018 08:25:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=JUfV9va6RmWp8BK7LQaxTCfU3OKTt96bTzHFUZvMO7w=; b=R6RMOatDFYi5OgJzSFYbCxxha/hS+Bk/biPunQQs1MbN1FzcDTy+QBOqSdpeVbjLYc zrWYtBauTflIw0yYNKNPYCR1y+glqBAr+s9rPzSTURLfmRvneUnI+AqOIDg5NyK8yCTd EVg6E/H31KOPVO05nm8IniL062te+GMSi4GOmSgMLltkuIfkXdLNFvXYtLiaiGb0T7BF ABTFRzthP6c0x1FUtnZ9UyDKvwDVJRLmgh9n04V1Hi+k7MEfh9evFw6adrkWuSD50Bpa sjwr8poJKS4quScxxqqEKFlEnySWK7wyr34ofKWTV6fhsOOgriGZiQqgC8VeepCv0/gs ls1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=JUfV9va6RmWp8BK7LQaxTCfU3OKTt96bTzHFUZvMO7w=; b=iRiGaaar1NMewX84M+KojYLMLxXgj1kbtGRxt3g6sck0oAgGpqj5cC/f6MT3q15AD6 HicOhPFSpfcFknghrH0kVuTWZoef5UqvKd7Zpem6Ey3aUEF/BLchtxZCGJPBteaGFkAq zXrg72JI+j3BNNPnnTJ6QvyV5qT0JMExlEheFvTVUKEUfWXkchp75K1JE5kvIcmL67dp daCtZ6lahwrK41PhHJqNAhXDivYf66seco5drkoAxS040rBE0AR1aT3/LStAz0L6ZYvM biv7fifSRuTyrkKiUUlC/QynWnKl9ZzJmAHwOpd7m8QEzpgkK/jU+/R/9mAiHueI/Vnh tYRA== X-Gm-Message-State: AKwxytcOIInSp1K4GFMoku2jDmG1h0TCgOb9De5cDflc9qsFQge9J+JU QFJfpHmWxg4f2vyku2yir64= X-Received: by 10.80.181.9 with SMTP id y9mr14072668edd.131.1516638319479; Mon, 22 Jan 2018 08:25:19 -0800 (PST) Received: from localhost.localdomain ([178.19.216.175]) by smtp.gmail.com with ESMTPSA id g21sm11920844edg.88.2018.01.22.08.25.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jan 2018 08:25:18 -0800 (PST) From: Alban Crequy X-Google-Original-From: Alban Crequy To: alban@kinvolk.io Cc: dongsu@kinvolk.io, iago@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.hu, viro@zeniv.linux.org.uk, zohar@linux.vnet.ibm.com, dmitry.kasatkin@gmail.com, james.l.morris@oracle.com, serge@hallyn.com, seth.forshee@canonical.com, hch@infradead.org Subject: [RFC PATCH v3 1/2] fuse: introduce new fs_type flag FS_IMA_NO_CACHE Date: Mon, 22 Jan 2018 17:24:51 +0100 Message-Id: <20180122162452.8756-2-alban@kinvolk.io> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180122162452.8756-1-alban@kinvolk.io> References: <20180122162452.8756-1-alban@kinvolk.io> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alban Crequy This new fs_type flag FS_IMA_NO_CACHE means files should be re-measured, re-appraised and re-audited each time. Cached integrity results should not be used. It is useful in FUSE because the userspace FUSE process can change the underlying files at any time without notifying the kernel. Cc: linux-kernel@vger.kernel.org Cc: linux-integrity@vger.kernel.org Cc: linux-security-module@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org Cc: Miklos Szeredi Cc: Alexander Viro Cc: Mimi Zohar Cc: Dmitry Kasatkin Cc: James Morris Cc: "Serge E. Hallyn" Cc: Seth Forshee Cc: Christoph Hellwig Tested-by: Dongsu Park Signed-off-by: Alban Crequy --- fs/fuse/inode.c | 2 +- include/linux/fs.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 624f18bbfd2b..0a9e516461d5 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -1205,7 +1205,7 @@ static void fuse_kill_sb_anon(struct super_block *sb) static struct file_system_type fuse_fs_type = { .owner = THIS_MODULE, .name = "fuse", - .fs_flags = FS_HAS_SUBTYPE, + .fs_flags = FS_HAS_SUBTYPE | FS_IMA_NO_CACHE, .mount = fuse_mount, .kill_sb = fuse_kill_sb_anon, }; diff --git a/include/linux/fs.h b/include/linux/fs.h index 511fbaabf624..ced841ba6701 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_IMA_NO_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 *); -- 2.13.6