Skip to content

Commit

Permalink
audit: Do not send uninitialized data for AUDIT_TTY_GET
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Gleixner authored and Al Viro committed Oct 30, 2010
1 parent 3c80fe4 commit 2070320
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 2070320

Please sign in to comment.