summaryrefslogtreecommitdiffstats
path: root/kernel/audit.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-12-09 15:19:35 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2010-10-30 14:45:42 +0200
commit207032051a5ed38df332729ba42e98e9a1e60434 (patch)
tree632311aa731ce8cda33888b54816837f2d1529bd /kernel/audit.c
parentaudit: Call tty_audit_push_task() outside preempt disabled (diff)
downloadlinux-207032051a5ed38df332729ba42e98e9a1e60434.tar.xz
linux-207032051a5ed38df332729ba42e98e9a1e60434.zip
audit: Do not send uninitialized data for AUDIT_TTY_GET
audit_receive_msg() sends uninitialized data for AUDIT_TTY_GET when the task was not found. Send reply only when task was found. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Eric Paris <eparis@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r--kernel/audit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index 8429afea37bf..57f4038694d1 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -884,8 +884,10 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
spin_unlock_irq(&tsk->sighand->siglock);
}
read_unlock(&tasklist_lock);
- audit_send_reply(NETLINK_CB(skb).pid, seq, AUDIT_TTY_GET, 0, 0,
- &s, sizeof(s));
+
+ if (!err)
+ audit_send_reply(NETLINK_CB(skb).pid, seq,
+ AUDIT_TTY_GET, 0, 0, &s, sizeof(s));
break;
}
case AUDIT_TTY_SET: {