]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: Fix an uninitialized variable BUG/panic in selinux_secattr_to_sid()
authorPaul Moore <paul.moore@hp.com>
Fri, 3 Oct 2008 14:51:15 +0000 (10:51 -0400)
committerJames Morris <jmorris@namei.org>
Fri, 3 Oct 2008 22:25:18 +0000 (08:25 +1000)
commit90e980cdb718fc3a6dcd6922f589c9a4f7f8ccd7
treea4342a6b272a8be9acc16131d39d971536a3e8da
parent7a0be714e443abcc5afaad0c52eabf1a8e92a0fc
selinux: Fix an uninitialized variable BUG/panic in selinux_secattr_to_sid()

At some point during the 2.6.27 development cycle two new fields were added
to the SELinux context structure, a string pointer and a length field.  The
code in selinux_secattr_to_sid() was not modified and as a result these two
fields were left uninitialized which could result in erratic behavior,
including kernel panics, when NetLabel is used.  This patch fixes the
problem by fully initializing the context in selinux_secattr_to_sid() before
use and reducing the level of direct context manipulation done to help
prevent future problems.

Please apply this to the 2.6.27-rcX release stream.

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