• Paul Moore's avatar
    netlabel: improve domain mapping validation · 6b21e1b7
    Paul Moore authored
    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>
    6b21e1b7
netlabel_domainhash.c 22.3 KB