[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220905075837.1083216-3-cuigaosheng1@huawei.com>
Date: Mon, 5 Sep 2022 15:58:35 +0800
From: Gaosheng Cui <cuigaosheng1@...wei.com>
To: <zohar@...ux.ibm.com>, <dmitry.kasatkin@...il.com>,
<paul@...l-moore.com>, <jmorris@...ei.org>, <serge@...lyn.com>,
<cuigaosheng1@...wei.com>
CC: <linux-integrity@...r.kernel.org>,
<linux-security-module@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH -next 2/4] ima: Use DECLARE_FLEX_ARRAY() helper in ima_template_entry
Zero-length arrays are deprecated and we are moving towards adopting
C99 flexible-array members instead. So, replace zero-length array
declaration with the new DECLARE_FLEX_ARRAY() helper macro in struct
ima_template_entry.
This helper allows for a flexible-array member in a union.
Link: KSPP#21
Link: KSPP#193
Link: KSPP#197
Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
Signed-off-by: Gaosheng Cui <cuigaosheng1@...wei.com>
---
security/integrity/ima/ima.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h
index be965a8715e4..15687e79944b 100644
--- a/security/integrity/ima/ima.h
+++ b/security/integrity/ima/ima.h
@@ -100,7 +100,7 @@ struct ima_template_entry {
struct tpm_digest *digests;
struct ima_template_desc *template_desc; /* template descriptor */
u32 template_data_len;
- struct ima_field_data template_data[]; /* template related data */
+ DECLARE_FLEX_ARRAY(struct ima_field_data, template_data); /* template related data */
};
struct ima_queue_entry {
--
2.25.1
Powered by blists - more mailing lists