• Eric Paris's avatar
    security: secid_to_secctx returns len when data is NULL · d5630b9d
    Eric Paris authored
    With the (long ago) interface change to have the secid_to_secctx functions
    do the string allocation instead of having the caller do the allocation we
    lost the ability to query the security server for the length of the
    upcoming string.  The SECMARK code would like to allocate a netlink skb
    with enough length to hold the string but it is just too unclean to do the
    string allocation twice or to do the allocation the first time and hold
    onto the string and slen.  This patch adds the ability to call
    security_secid_to_secctx() with a NULL data pointer and it will just set
    the slen pointer.
    Signed-off-by: default avatarEric Paris <eparis@redhat.com>
    Reviewed-by: default avatarPaul Moore <paul.moore@hp.com>
    Signed-off-by: default avatarJames Morris <jmorris@namei.org>
    d5630b9d
smack_lsm.c 75.8 KB