Re: [PATCH][next] integrity: Use static_assert() to check struct sizes

2024-10-09 Thread Mimi Zohar
On Thu, 2024-08-08 at 16:04 -0600, Gustavo A. R. Silva wrote: > Commit 38aa3f5ac6d2 ("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

Re: [PATCH v5][next] integrity: Avoid -Wflex-array-member-not-at-end warnings

2024-04-05 Thread Mimi Zohar
On Thu, 2024-04-04 at 18:56 -0600, Gustavo A. R. Silva wrote: > > "checkpatch.pl --strict" complains "CHECK: Alignment should match open > > parenthesis". I'll queue the patch, but how about teaching checkpatch.pl to > > ignore __struct_group()? > > I think this would do it: > > diff --git a/scr

Re: [PATCH v5][next] integrity: Avoid -Wflex-array-member-not-at-end warnings

2024-04-04 Thread Mimi Zohar
On Thu, 2024-04-04 at 12:49 -0400, Mimi Zohar wrote: > Hi Gustavo, > > On Thu, 2024-04-04 at 09:00 -0600, Gustavo A. R. Silva wrote: > > -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting > > ready to enable it globally. > > > > There is curre

Re: [PATCH v5][next] integrity: Avoid -Wflex-array-member-not-at-end warnings

2024-04-04 Thread Mimi Zohar
member is not at the end of another structure [- > Wflex-array-member-not-at-end] > security/integrity/platform_certs/../integrity.h:68:32: warning: structure > containing a flexible array member is not at the end of another structure [- > Wflex-array-member-not-at-end] > > Link: ht

Re: [PATCH v3][next] integrity: Avoid -Wflex-array-member-not-at-end warnings

2024-03-21 Thread Mimi Zohar
> Signed-off-by: Gustavo A. R. Silva > --- > Changes in v3: > - struct ima_digest_data is a packed structure. So, to keep things >consistent, use the attribute __packed on the tagged struct >ima_digest_data_hdr. For this, we use __struct_group() instead of >struct_group_tagged(). Update the changelog text, accordingly. > > Changes in v2: > - Include changes for `struct evm_digest` (Mimi Zohar) >

Re: [PATCH][next] integrity: Avoid -Wflex-array-member-not-at-end warnings

2024-03-20 Thread Mimi Zohar
Hi Gustavo, Sorry for the delay... On Mon, 2024-03-04 at 11:52 -0600, Gustavo A. R. Silva wrote: > -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting > ready to enable it globally. > > There is currently an object (`hdr)` in `struct ima_max_digest_data` > that contains a flex

Re: [PATCH] ima: Add __counted_by for struct modsig and use struct_size()

2023-10-18 Thread Mimi Zohar
t; > Signed-off-by: Gustavo A. R. Silva Reviewed-by: Mimi Zohar