netlabel: improve domain mapping validation
authorPaul Moore <pmoore@redhat.com>
Fri, 17 May 2013 09:08:50 +0000 (09:08 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 29 Jun 2013 03:06:37 +0000 (04:06 +0100)
commit1bad210d6fe1e45dce824796d675f22b303a2fa5
tree3c2ecf123f708da90cd68a61a13d1957b08fa71e
parent2526f77c670a61ef2edd391f4f37727a100a040e
netlabel: improve domain mapping validation

[ Upstream commit 6b21e1b77d1a3d58ebfd513264c885695e8a0ba5 ]

The net/netlabel/netlabel_domainhash.c:netlbl_domhsh_add() function
does not properly validate new domain hash entries resulting in
potential problems when an administrator attempts to add an invalid
entry.  One such problem, as reported by Vlad Halilov, is a kernel
BUG (found in netlabel_domainhash.c:netlbl_domhsh_audit_add()) when
adding an IPv6 outbound mapping with a CIPSO configuration.

This patch corrects this problem by adding the necessary validation
code to netlbl_domhsh_add() via the newly created
netlbl_domhsh_validate() function.

Ideally this patch should also be pushed to the currently active
-stable trees.

Reported-by: Vlad Halilov <vlad.halilov@gmail.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/netlabel/netlabel_domainhash.c