summaryrefslogtreecommitdiff
path: root/kernel/auditfilter.c
diff options
context:
space:
mode:
authorXiu Jianfeng <xiujianfeng@huawei.com>2021-12-17 09:01:51 +0800
committerPaul Moore <paul@paul-moore.com>2021-12-20 14:42:11 -0500
commit30561b51cc8d1daa27a48eb29dd9424858576b19 (patch)
tree3335473cddc1f9159cbc12dde9eb9ce551bd3101 /kernel/auditfilter.c
parent8f110f530635af44fff1f4ee100ecef0bac62510 (diff)
audit: use struct_size() helper in audit_[send|make]_reply()
Make use of struct_size() helper instead of an open-coded calculation. Link: https://github.com/KSPP/linux/issues/160 Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'kernel/auditfilter.c')
-rw-r--r--kernel/auditfilter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index 398b4c57e921..1bbe25f47c17 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -1092,7 +1092,7 @@ static void audit_list_rules(int seq, struct sk_buff_head *q)
break;
skb = audit_make_reply(seq, AUDIT_LIST_RULES, 0, 1,
data,
- sizeof(*data) + data->buflen);
+ struct_size(data, buf, data->buflen));
if (skb)
skb_queue_tail(q, skb);
kfree(data);