diff options
author | Xiu Jianfeng <xiujianfeng@huawei.com> | 2021-12-17 02:01:51 +0100 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2021-12-20 20:42:11 +0100 |
commit | 30561b51cc8d1daa27a48eb29dd9424858576b19 (patch) | |
tree | 3335473cddc1f9159cbc12dde9eb9ce551bd3101 /kernel/audit.c | |
parent | audit: ensure userspace is penalized the same as the kernel when under pressure (diff) | |
download | linux-30561b51cc8d1daa27a48eb29dd9424858576b19.tar.xz linux-30561b51cc8d1daa27a48eb29dd9424858576b19.zip |
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/audit.c')
-rw-r--r-- | kernel/audit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index 3dd8bde2c00f..bc21d5007047 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -1459,7 +1459,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) security_release_secctx(ctx, len); } audit_send_reply(skb, seq, AUDIT_SIGNAL_INFO, 0, 0, - sig_data, sizeof(*sig_data) + len); + sig_data, struct_size(sig_data, ctx, len)); kfree(sig_data); break; case AUDIT_TTY_GET: { |