summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-12-09 14:35:10 +0100
committerThomas Gleixner <tglx@linutronix.de>2010-02-21 20:20:07 +0100
commit4c9a0a35cd3c2984a3c58bc22c7214472d01c9c9 (patch)
treed0eea091d33d32804312fe4dd88443ba3a3b2f6b
parenta95bd8cf879ef7b70fb441f9593459425746cb13 (diff)
downloadlwn-4c9a0a35cd3c2984a3c58bc22c7214472d01c9c9.tar.gz
lwn-4c9a0a35cd3c2984a3c58bc22c7214472d01c9c9.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>
-rw-r--r--kernel/audit.c6
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)
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: {