From: Thomas Gleixner Date: Wed, 9 Dec 2009 14:19:35 +0000 (+0000) Subject: audit: Do not send uninitialized data for AUDIT_TTY_GET X-Git-Tag: v3.0~2926^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=207032051a5ed38df332729ba42e98e9a1e60434;p=platform%2Fkernel%2Flinux-amlogic.git 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 Cc: Al Viro Cc: Eric Paris Signed-off-by: Al Viro --- diff --git a/kernel/audit.c b/kernel/audit.c index 8429afe..57f4038 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: {