Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2368113ybi; Thu, 20 Jun 2019 13:56:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqz0rWHzUR3zOmXibhXEPpdnCSSXCwGGOsu2lI4dbtR3/krYTne0vYmMvkCiWk5IzU8k/G0u X-Received: by 2002:a17:902:ac88:: with SMTP id h8mr49279797plr.12.1561064172260; Thu, 20 Jun 2019 13:56:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561064172; cv=none; d=google.com; s=arc-20160816; b=UREpbHXNMw7JG44+opMEjPkgaxeYqa807ILaFpLUXuKM7JolsX9vsZLye79U0VuVD0 21BHO6FXrvWLoeiOc2NjqH5ROmWYYFMnweYms0IyqA7ATj3zWCuOyfjwL6V+I/JREfUW zUB3GR4hnT0XHQdigDeL0zq9STeocxauuaWmSAVugaY1d4SOGdpT4Xd5JKuil+ee6gkE Qm6Ta0BJ7n6S13J9AX4iVZTeKmH++y4EWy9CkOLHNsDIHsce6tOrWAsz8H5xipruMwM9 av8iKbtomPg7Uj7kf9Yf6FPSFRB4OR2Q9Mxe5CoczRMaGt5ohOT1jkxTeDowHKmtMQ0E J3Qg== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xnF+GyYyh+63JvPzbqmKhad/yAQ7HrCrS9H2RnUIeoM=; b=z7ZDFjIufD/yUD3wK74qik4GHXM5NI84G34NG6Jjvqit+1OoHZC2DLpSpAh+mHoQT7 frYa71YrNCfT64s5ccq4hUyQXhbeNwpIm9Cau81qFwaXqw2kGNdqFpNdRfr2XGqzJdQw 1S1h+S+JPvHBuHISn6utOgJJiIOKjE9LB+cm831QHbA9NSvul0OlNuFJGHE9wnPRUfcJ 59mQGm2lWDPisMiJT7LcX0HRCK5McjGbBydDK4eiEAloqOT8Z/yPW2EXeEo482qrS3W0 G51ZeUe/8wY7wL0dZyolMioVTTfWtvPjnleoG/CoR0TlnIoLvgzlFys60LxXj1/rUgnx RHqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tadcRe2T; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x24si730691pjt.88.2019.06.20.13.55.58; Thu, 20 Jun 2019 13:56:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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=@kernel.org header.s=default header.b=tadcRe2T; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726343AbfFTUxq (ORCPT + 99 others); Thu, 20 Jun 2019 16:53:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:56566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726045AbfFTUxp (ORCPT ); Thu, 20 Jun 2019 16:53:45 -0400 Received: from ebiggers-linuxstation.mtv.corp.google.com (unknown [104.132.1.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 782D421537; Thu, 20 Jun 2019 20:53:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561064024; bh=vcCYxPuDCEYHCOIowNevzW5TNlAhe/X3psmBGsNYXiI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tadcRe2TopNhBnHh4yTX4s5CSUOhT3TAeiJydN0hyc02Djv5c5j7J3NTK4Rc/l1xb X6wB2TijpGwi9gqUU9Yvh4cDokRkZkMp4qxEO19/8VHJXHfZTg0805Ehwo95UpkHW4 tzDOIs0sVWiGnUJeR9LIHp3gwXpjOXV5y5YrYj18= From: Eric Biggers To: linux-fscrypt@vger.kernel.org Cc: linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-integrity@vger.kernel.org, Jaegeuk Kim , "Theodore Y . Ts'o" , Victor Hsieh , Chandan Rajendra , Dave Chinner , Christoph Hellwig , "Darrick J . Wong" , Linus Torvalds Subject: [PATCH v5 06/16] fs-verity: add inode and superblock fields Date: Thu, 20 Jun 2019 13:50:33 -0700 Message-Id: <20190620205043.64350-7-ebiggers@kernel.org> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog In-Reply-To: <20190620205043.64350-1-ebiggers@kernel.org> References: <20190620205043.64350-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Eric Biggers Analogous to fs/crypto/, add fields to the VFS inode and superblock for use by the fs/verity/ support layer: - ->s_vop: points to the fsverity_operations if the filesystem supports fs-verity, otherwise is NULL. - ->i_verity_info: points to cached fs-verity information for the inode after someone opens it, otherwise is NULL. - S_VERITY: bit in ->i_flags that identifies verity inodes, even when they haven't been opened yet and thus still have NULL ->i_verity_info. Reviewed-by: Theodore Ts'o Signed-off-by: Eric Biggers --- include/linux/fs.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index f7fdfe93e25d3e..a80a192cdcf285 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -64,6 +64,8 @@ struct workqueue_struct; struct iov_iter; struct fscrypt_info; struct fscrypt_operations; +struct fsverity_info; +struct fsverity_operations; struct fs_context; struct fs_parameter_description; @@ -723,6 +725,10 @@ struct inode { struct fscrypt_info *i_crypt_info; #endif +#ifdef CONFIG_FS_VERITY + struct fsverity_info *i_verity_info; +#endif + void *i_private; /* fs or device private pointer */ } __randomize_layout; @@ -1429,6 +1435,9 @@ struct super_block { const struct xattr_handler **s_xattr; #ifdef CONFIG_FS_ENCRYPTION const struct fscrypt_operations *s_cop; +#endif +#ifdef CONFIG_FS_VERITY + const struct fsverity_operations *s_vop; #endif struct hlist_bl_head s_roots; /* alternate root dentries for NFS */ struct list_head s_mounts; /* list of mounts; _not_ for fs use */ @@ -1964,6 +1973,7 @@ struct super_operations { #endif #define S_ENCRYPTED 16384 /* Encrypted file (using fs/crypto/) */ #define S_CASEFOLD 32768 /* Casefolded file */ +#define S_VERITY 65536 /* Verity file (using fs/verity/) */ /* * Note that nosuid etc flags are inode-specific: setting some file-system @@ -2005,6 +2015,7 @@ static inline bool sb_rdonly(const struct super_block *sb) { return sb->s_flags #define IS_DAX(inode) ((inode)->i_flags & S_DAX) #define IS_ENCRYPTED(inode) ((inode)->i_flags & S_ENCRYPTED) #define IS_CASEFOLDED(inode) ((inode)->i_flags & S_CASEFOLD) +#define IS_VERITY(inode) ((inode)->i_flags & S_VERITY) #define IS_WHITEOUT(inode) (S_ISCHR(inode->i_mode) && \ (inode)->i_rdev == WHITEOUT_DEV) -- 2.22.0.410.gd8fdbe21b5-goog