• Paul Moore's avatar
    netlabel: improve domain mapping validation · 1bad210d
    Paul Moore authored
    [ Upstream commit 6b21e1b7 ]
    
    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: default avatarVlad Halilov <vlad.halilov@gmail.com>
    Signed-off-by: default avatarPaul Moore <pmoore@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    1bad210d
netlabel_domainhash.c 22.6 KB