]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: Fix a problem in security_netlbl_sid_to_secattr()
authorPaul Moore <paul.moore@hp.com>
Fri, 10 Oct 2008 14:16:30 +0000 (10:16 -0400)
committerPaul Moore <paul.moore@hp.com>
Fri, 10 Oct 2008 14:16:30 +0000 (10:16 -0400)
commitdf68664a285b21f9420ecdbc214038e04976e4b3
treed9da2a23471f38f6b25ec2bcfe982622ee51adba
parent5c3bcdae9c6b784341a6dc8b857e5c268eeef17f
selinux: Fix a problem in security_netlbl_sid_to_secattr()

Currently when SELinux fails to allocate memory in
security_netlbl_sid_to_secattr() the NetLabel LSM domain field is set to
NULL which triggers the default NetLabel LSM domain mapping which may not
always be the desired mapping.  This patch fixes this by returning an error
when the kernel is unable to allocate memory.  This could result in more
failures on a system with heavy memory pressure but it is the "correct"
thing to do.

Signed-off-by: Paul Moore <paul.moore@hp.com>
Acked-by: James Morris <jmorris@namei.org>
security/selinux/ss/services.c