Messages in this thread Patch in this message | | | Date | Tue, 07 Sep 2010 14:00:04 -0000 | From | Thomas Gleixner <> | Subject | [patch 2/3] 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> Cc: Peter Zijlstra <peterz@infradead.org>
--- kernel/audit.c | 6 ++++-- kernel/audit.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) Index: linux-2.6/kernel/audit.c =================================================================== --- linux-2.6.orig/kernel/audit.c +++ linux-2.6/kernel/audit.c @@ -884,8 +884,10 @@ static int audit_receive_msg(struct sk_b 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: {
| |