selinux: properly handle multiple messages in selinux_netlink_send()
authorPaul Moore <paul@paul-moore.com>
Tue, 28 Apr 2020 13:59:02 +0000 (09:59 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 May 2020 17:14:41 +0000 (19:14 +0200)
commit6affa87d168d91af6c8f303dc1fc7a7f59869818
tree6bc530dd83b78cc34fc1d8009c677b653e682165
parente66e9687af44de166fa9b7c079cc34b41a742577
selinux: properly handle multiple messages in selinux_netlink_send()

commit fb73974172ffaaf57a7c42f35424d9aece1a5af6 upstream.

Fix the SELinux netlink_send hook to properly handle multiple netlink
messages in a single sk_buff; each message is parsed and subject to
SELinux access control.  Prior to this patch, SELinux only inspected
the first message in the sk_buff.

Cc: stable@vger.kernel.org
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
security/selinux/hooks.c