diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-12-09 08:35:10 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-02-21 14:20:07 -0500 |
commit | 4c9a0a35cd3c2984a3c58bc22c7214472d01c9c9 (patch) | |
tree | d0eea091d33d32804312fe4dd88443ba3a3b2f6b /kernel/audit.c | |
parent | a95bd8cf879ef7b70fb441f9593459425746cb13 (diff) |
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>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r-- | kernel/audit.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index 5feed232be9d..bf307ddf7d03 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -891,8 +891,10 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
891 | spin_unlock_irq(&tsk->sighand->siglock); | 891 | spin_unlock_irq(&tsk->sighand->siglock); |
892 | } | 892 | } |
893 | read_unlock(&tasklist_lock); | 893 | read_unlock(&tasklist_lock); |
894 | audit_send_reply(NETLINK_CB(skb).pid, seq, AUDIT_TTY_GET, 0, 0, | 894 | |
895 | &s, sizeof(s)); | 895 | if (!err) |
896 | audit_send_reply(NETLINK_CB(skb).pid, seq, | ||
897 | AUDIT_TTY_GET, 0, 0, &s, sizeof(s)); | ||
896 | break; | 898 | break; |
897 | } | 899 | } |
898 | case AUDIT_TTY_SET: { | 900 | case AUDIT_TTY_SET: { |