summaryrefslogtreecommitdiffstats
path: root/kernel/audit.c
diff options
context:
space:
mode:
authorEric Paris2013-11-05 16:48:02 +0100
committerEric Paris2013-11-05 17:08:35 +0100
commite13f91e3c57986a609c10ddf94af0546a2a97dce (patch)
tree71c58b8eaa95bcffb554052794f3c99e767104da /kernel/audit.c
parentaudit: fix info leak in AUDIT_GET requests (diff)
downloadkernel-qcow2-linux-e13f91e3c57986a609c10ddf94af0546a2a97dce.tar.gz
kernel-qcow2-linux-e13f91e3c57986a609c10ddf94af0546a2a97dce.tar.xz
kernel-qcow2-linux-e13f91e3c57986a609c10ddf94af0546a2a97dce.zip
audit: use memset instead of trying to initialize field by field
We currently are setting fields to 0 to initialize the structure declared on the stack. This is a bad idea as if the structure has holes or unpacked space these will not be initialized. Just use memset. This is not a performance critical section of code. Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r--kernel/audit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index e0f7767e4a3d..3ce60e063aae 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -759,7 +759,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
switch (msg_type) {
case AUDIT_GET:
- status_set.mask = 0;
+ memset(&status_set, 0, sizeof(status_set));
status_set.enabled = audit_enabled;
status_set.failure = audit_failure;
status_set.pid = audit_pid;