forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/fs/verity/enable.c
....@@ -177,7 +177,7 @@
177177 * (level 0) and ascending to the root node (level 'num_levels - 1').
178178 * Then at the end (level 'num_levels'), calculate the root hash.
179179 */
180
- blocks = (inode->i_size + params->block_size - 1) >>
180
+ blocks = ((u64)inode->i_size + params->block_size - 1) >>
181181 params->log_blocksize;
182182 for (level = 0; level <= params->num_levels; level++) {
183183 err = build_merkle_tree_level(filp, level, blocks, params,
....@@ -356,7 +356,7 @@
356356 if (arg.block_size != PAGE_SIZE)
357357 return -EINVAL;
358358
359
- if (arg.salt_size > FIELD_SIZEOF(struct fsverity_descriptor, salt))
359
+ if (arg.salt_size > sizeof_field(struct fsverity_descriptor, salt))
360360 return -EMSGSIZE;
361361
362362 if (arg.sig_size > FS_VERITY_MAX_SIGNATURE_SIZE)