.. | .. |
---|
115 | 115 | |
---|
116 | 116 | static inline struct fsverity_info *fsverity_get_info(const struct inode *inode) |
---|
117 | 117 | { |
---|
118 | | - /* pairs with the cmpxchg() in fsverity_set_info() */ |
---|
119 | | - return READ_ONCE(inode->i_verity_info); |
---|
| 118 | + /* |
---|
| 119 | + * Pairs with the cmpxchg_release() in fsverity_set_info(). |
---|
| 120 | + * I.e., another task may publish ->i_verity_info concurrently, |
---|
| 121 | + * executing a RELEASE barrier. We need to use smp_load_acquire() here |
---|
| 122 | + * to safely ACQUIRE the memory the other task published. |
---|
| 123 | + */ |
---|
| 124 | + return smp_load_acquire(&inode->i_verity_info); |
---|
120 | 125 | } |
---|
121 | 126 | |
---|
122 | 127 | /* enable.c */ |
---|
.. | .. |
---|
132 | 137 | int fsverity_file_open(struct inode *inode, struct file *filp); |
---|
133 | 138 | int fsverity_prepare_setattr(struct dentry *dentry, struct iattr *attr); |
---|
134 | 139 | void fsverity_cleanup_inode(struct inode *inode); |
---|
| 140 | + |
---|
| 141 | +/* read_metadata.c */ |
---|
| 142 | + |
---|
| 143 | +int fsverity_ioctl_read_metadata(struct file *filp, const void __user *uarg); |
---|
135 | 144 | |
---|
136 | 145 | /* verify.c */ |
---|
137 | 146 | |
---|
.. | .. |
---|
178 | 187 | { |
---|
179 | 188 | } |
---|
180 | 189 | |
---|
| 190 | +/* read_metadata.c */ |
---|
| 191 | + |
---|
| 192 | +static inline int fsverity_ioctl_read_metadata(struct file *filp, |
---|
| 193 | + const void __user *uarg) |
---|
| 194 | +{ |
---|
| 195 | + return -EOPNOTSUPP; |
---|
| 196 | +} |
---|
| 197 | + |
---|
181 | 198 | /* verify.c */ |
---|
182 | 199 | |
---|
183 | 200 | static inline bool fsverity_verify_page(struct page *page) |
---|
.. | .. |
---|
218 | 235 | |
---|
219 | 236 | #ifdef CONFIG_FS_VERITY_BUILTIN_SIGNATURES |
---|
220 | 237 | int __fsverity_verify_signature(const struct inode *inode, const u8 *signature, |
---|
221 | | - u32 sig_size, const u8 *file_digest, |
---|
| 238 | + size_t sig_size, const u8 *file_digest, |
---|
222 | 239 | unsigned int digest_algorithm); |
---|
223 | 240 | #else /* !CONFIG_FS_VERITY_BUILTIN_SIGNATURES */ |
---|
224 | 241 | static inline int __fsverity_verify_signature(const struct inode *inode, |
---|
225 | | - const u8 *signature, u32 sig_size, |
---|
| 242 | + const u8 *signature, size_t sig_size, |
---|
226 | 243 | const u8 *file_digest, |
---|
227 | 244 | unsigned int digest_algorithm) |
---|
228 | 245 | { |
---|