Paul Lawrence | 5bb92df | 2020-10-26 09:36:39 -0700 | [diff] [blame] | 1 | /* 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 Lawrence | c630401 | 2020-08-12 15:12:47 -0700 | [diff] [blame] | 9 | /* Arbitrary limit to bound the kmalloc() size. Can be changed. */ |
| 10 | #define FS_VERITY_MAX_SIGNATURE_SIZE 16128 |
| 11 | |
Paul Lawrence | 5bb92df | 2020-10-26 09:36:39 -0700 | [diff] [blame] | 12 | #ifdef CONFIG_FS_VERITY |
| 13 | |
| 14 | int incfs_ioctl_enable_verity(struct file *filp, const void __user *uarg); |
Paul Lawrence | 850059d | 2020-12-17 11:28:02 -0800 | [diff] [blame] | 15 | int incfs_ioctl_measure_verity(struct file *filp, void __user *_uarg); |
Paul Lawrence | 5bb92df | 2020-10-26 09:36:39 -0700 | [diff] [blame] | 16 | |
Paul Lawrence | c630401 | 2020-08-12 15:12:47 -0700 | [diff] [blame] | 17 | int incfs_fsverity_file_open(struct inode *inode, struct file *filp); |
Paul Lawrence | f4c368a | 2021-03-12 09:54:28 -0800 | [diff] [blame] | 18 | int incfs_ioctl_read_verity_metadata(struct file *filp, |
| 19 | const void __user *uarg); |
Paul Lawrence | c630401 | 2020-08-12 15:12:47 -0700 | [diff] [blame] | 20 | |
Paul Lawrence | 5bb92df | 2020-10-26 09:36:39 -0700 | [diff] [blame] | 21 | #else /* !CONFIG_FS_VERITY */ |
| 22 | |
| 23 | static inline int incfs_ioctl_enable_verity(struct file *filp, |
| 24 | const void __user *uarg) |
| 25 | { |
| 26 | return -EOPNOTSUPP; |
| 27 | } |
| 28 | |
Paul Lawrence | 850059d | 2020-12-17 11:28:02 -0800 | [diff] [blame] | 29 | static inline int incfs_ioctl_measure_verity(struct file *filp, |
| 30 | void __user *_uarg) |
| 31 | { |
| 32 | return -EOPNOTSUPP; |
| 33 | } |
| 34 | |
Paul Lawrence | c630401 | 2020-08-12 15:12:47 -0700 | [diff] [blame] | 35 | static inline int incfs_fsverity_file_open(struct inode *inode, |
| 36 | struct file *filp) |
| 37 | { |
| 38 | return -EOPNOTSUPP; |
| 39 | } |
| 40 | |
Paul Lawrence | f4c368a | 2021-03-12 09:54:28 -0800 | [diff] [blame] | 41 | static inline int incfs_ioctl_read_verity_metadata(struct file *filp, |
| 42 | const void __user *uarg) |
| 43 | { |
| 44 | return -EOPNOTSUPP; |
| 45 | } |
| 46 | |
Paul Lawrence | 5bb92df | 2020-10-26 09:36:39 -0700 | [diff] [blame] | 47 | #endif /* !CONFIG_FS_VERITY */ |
| 48 | |
| 49 | #endif |