b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [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 | |
| 9 | /* Arbitrary limit to bound the kmalloc() size. Can be changed. */ |
| 10 | #define FS_VERITY_MAX_SIGNATURE_SIZE 16128 |
| 11 | |
| 12 | #ifdef CONFIG_FS_VERITY |
| 13 | |
| 14 | int incfs_ioctl_enable_verity(struct file *filp, const void __user *uarg); |
| 15 | int incfs_ioctl_measure_verity(struct file *filp, void __user *_uarg); |
| 16 | |
| 17 | int incfs_fsverity_file_open(struct inode *inode, struct file *filp); |
| 18 | int incfs_ioctl_read_verity_metadata(struct file *filp, |
| 19 | const void __user *uarg); |
| 20 | |
| 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 | |
| 29 | static inline int incfs_ioctl_measure_verity(struct file *filp, |
| 30 | void __user *_uarg) |
| 31 | { |
| 32 | return -EOPNOTSUPP; |
| 33 | } |
| 34 | |
| 35 | static inline int incfs_fsverity_file_open(struct inode *inode, |
| 36 | struct file *filp) |
| 37 | { |
| 38 | return -EOPNOTSUPP; |
| 39 | } |
| 40 | |
| 41 | static inline int incfs_ioctl_read_verity_metadata(struct file *filp, |
| 42 | const void __user *uarg) |
| 43 | { |
| 44 | return -EOPNOTSUPP; |
| 45 | } |
| 46 | |
| 47 | #endif /* !CONFIG_FS_VERITY */ |
| 48 | |
| 49 | #endif |