blob: 8fcdbc8b93d6163b2be1c7dcf4df1297c2c79f3d [file] [log] [blame]
Paul Lawrence5bb92df2020-10-26 09:36:39 -07001/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright 2020 Google LLC
4 */
5
6#ifndef _INCFS_VERITY_H
7#define _INCFS_VERITY_H
8
Paul Lawrencec6304012020-08-12 15:12:47 -07009/* Arbitrary limit to bound the kmalloc() size. Can be changed. */
10#define FS_VERITY_MAX_SIGNATURE_SIZE 16128
11
Paul Lawrence5bb92df2020-10-26 09:36:39 -070012#ifdef CONFIG_FS_VERITY
13
14int incfs_ioctl_enable_verity(struct file *filp, const void __user *uarg);
Paul Lawrence850059d2020-12-17 11:28:02 -080015int incfs_ioctl_measure_verity(struct file *filp, void __user *_uarg);
Paul Lawrence5bb92df2020-10-26 09:36:39 -070016
Paul Lawrencec6304012020-08-12 15:12:47 -070017int incfs_fsverity_file_open(struct inode *inode, struct file *filp);
Paul Lawrencef4c368a2021-03-12 09:54:28 -080018int incfs_ioctl_read_verity_metadata(struct file *filp,
19 const void __user *uarg);
Paul Lawrencec6304012020-08-12 15:12:47 -070020
Paul Lawrence5bb92df2020-10-26 09:36:39 -070021#else /* !CONFIG_FS_VERITY */
22
23static inline int incfs_ioctl_enable_verity(struct file *filp,
24 const void __user *uarg)
25{
26 return -EOPNOTSUPP;
27}
28
Paul Lawrence850059d2020-12-17 11:28:02 -080029static inline int incfs_ioctl_measure_verity(struct file *filp,
30 void __user *_uarg)
31{
32 return -EOPNOTSUPP;
33}
34
Paul Lawrencec6304012020-08-12 15:12:47 -070035static inline int incfs_fsverity_file_open(struct inode *inode,
36 struct file *filp)
37{
38 return -EOPNOTSUPP;
39}
40
Paul Lawrencef4c368a2021-03-12 09:54:28 -080041static inline int incfs_ioctl_read_verity_metadata(struct file *filp,
42 const void __user *uarg)
43{
44 return -EOPNOTSUPP;
45}
46
Paul Lawrence5bb92df2020-10-26 09:36:39 -070047#endif /* !CONFIG_FS_VERITY */
48
49#endif