diff options
author | Eric Biggers <ebiggers@google.com> | 2019-07-22 19:26:22 +0300 |
---|---|---|
committer | Eric Biggers <ebiggers@google.com> | 2019-07-29 02:59:16 +0300 |
commit | c1d9b584e2cf3f0562d8fcf34574c044d17853a1 (patch) | |
tree | 9c0c25b8bb3e53a55ffb9d86faae9cff7c56d012 /include/linux | |
parent | fd2d1acfcadfe2e42567afaec5e989b38061a7d2 (diff) | |
download | linux-c1d9b584e2cf3f0562d8fcf34574c044d17853a1.tar.xz |
fs-verity: add the hook for file ->setattr()
Add a function fsverity_prepare_setattr() which filesystems that support
fs-verity must call to deny truncates of verity files.
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/fsverity.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/fsverity.h b/include/linux/fsverity.h index 09b04dab6452..cbd0f84e1620 100644 --- a/include/linux/fsverity.h +++ b/include/linux/fsverity.h @@ -46,6 +46,7 @@ static inline struct fsverity_info *fsverity_get_info(const struct inode *inode) /* open.c */ extern int fsverity_file_open(struct inode *inode, struct file *filp); +extern int fsverity_prepare_setattr(struct dentry *dentry, struct iattr *attr); extern void fsverity_cleanup_inode(struct inode *inode); #else /* !CONFIG_FS_VERITY */ @@ -62,6 +63,12 @@ static inline int fsverity_file_open(struct inode *inode, struct file *filp) return IS_VERITY(inode) ? -EOPNOTSUPP : 0; } +static inline int fsverity_prepare_setattr(struct dentry *dentry, + struct iattr *attr) +{ + return IS_VERITY(d_inode(dentry)) ? -EOPNOTSUPP : 0; +} + static inline void fsverity_cleanup_inode(struct inode *inode) { } |