mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 13:22:23 +00:00
fs-verity: Use struct_size() helper in enable_verity()
Follow the best practice for allocating a variable-sized structure. Signed-off-by: Zhang Jianhua <chris.zjh@huawei.com> [ebiggers: adjusted commit message] Signed-off-by: Eric Biggers <ebiggers@google.com> Link: https://lore.kernel.org/r/20220519022450.2434483-1-chris.zjh@huawei.com
This commit is contained in:
parent
b0487ede1f
commit
e6af1bb077
@ -202,7 +202,7 @@ static int enable_verity(struct file *filp,
|
|||||||
const struct fsverity_operations *vops = inode->i_sb->s_vop;
|
const struct fsverity_operations *vops = inode->i_sb->s_vop;
|
||||||
struct merkle_tree_params params = { };
|
struct merkle_tree_params params = { };
|
||||||
struct fsverity_descriptor *desc;
|
struct fsverity_descriptor *desc;
|
||||||
size_t desc_size = sizeof(*desc) + arg->sig_size;
|
size_t desc_size = struct_size(desc, signature, arg->sig_size);
|
||||||
struct fsverity_info *vi;
|
struct fsverity_info *vi;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user