]> git.baikalelectronics.ru Git - kernel.git/commit
audit: fix incorrect set of audit_sock
authorGao feng <gaofeng@cn.fujitsu.com>
Tue, 17 Dec 2013 03:10:42 +0000 (11:10 +0800)
committerEric Paris <eparis@redhat.com>
Tue, 14 Jan 2014 03:32:49 +0000 (22:32 -0500)
commit3f65afcd829e2af413889f510d0ae29d76b00497
tree1398d88a4f074862def8c855b2ed5a62d673beb8
parent77197d41240df1b3e4e6578966766bc6d0edb07c
audit: fix incorrect set of audit_sock

NETLINK_CB(skb).sk is the socket of user space process,
netlink_unicast in kauditd_send_skb wants the kernel
side socket. Since the sk_state of audit netlink socket
is not NETLINK_CONNECTED, so the netlink_getsockbyportid
doesn't return -ECONNREFUSED.

And the socket of userspace process can be released anytime,
so the audit_sock may point to invalid socket.

this patch sets the audit_sock to the kernel side audit
netlink socket.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
kernel/audit.c