]> git.baikalelectronics.ru Git - kernel.git/commit
security: secid_to_secctx returns len when data is NULL
authorEric Paris <eparis@redhat.com>
Wed, 13 Oct 2010 20:24:48 +0000 (16:24 -0400)
committerJames Morris <jmorris@namei.org>
Wed, 20 Oct 2010 23:12:50 +0000 (10:12 +1100)
commit553a0023876e5632ca284fe2901e34b9f211810e
tree4e97cadf12518fb107f9e7140fa94343bd6643f5
parent91b93a832db683e46f352a6a8dca39026fa1027a
security: secid_to_secctx returns len when data is NULL

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: Eric Paris <eparis@redhat.com>
Reviewed-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: James Morris <jmorris@namei.org>
include/linux/security.h
security/selinux/ss/services.c
security/smack/smack_lsm.c