Commit 08ae3e5f authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Mimi Zohar
Browse files

integrity: Use static_assert() to check struct sizes



Commit 38aa3f5a ("integrity: Avoid -Wflex-array-member-not-at-end
warnings") introduced tagged `struct evm_ima_xattr_data_hdr` and
`struct ima_digest_data_hdr`. We want to ensure that when new members
need to be added to the flexible structures, they are always included
within these tagged structs.

So, we use `static_assert()` to ensure that the memory layout for
both the flexible structure and the tagged struct is the same after
any changes.

Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
Tested-by: default avatarRoberto Sassu <roberto.sassu@huawei.com>
Reviewed-by: default avatarRoberto Sassu <roberto.sassu@huawei.com>
Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
parent 699ae624
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment