Commit 10c06e62 authored by Paul Moore's avatar Paul Moore Committed by Chris Wright

[PATCH] SELinux: fix an oops with NetLabel and non-MLS SELinux policy

In the case where a user has configured NetLabel in the kernel but is not
using a SELinux policy with the MLS/MCS feature enabled there is a bug in
mls_export_cat() where a NULL pointer is used.  The initial problem report and
discussion can be found here (this patch has been ACK'd by Stephen Smalley and
 James Morris in the discussion thread below):

 * http://marc2.theaimsgroup.com/?t=116920302500004&r=1&w=2

This patch is specific to the 2.6.19.y kernel series as the mls_export_cat()
function has been replaced in the 2.6.20 kernel.
Signed-off-by: default avatarPaul Moore <paul.moore@hp.com>
Acked-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
Acked-by: default avatarJames Morris <jmorris@namei.org>
Signed-off-by: default avatarChris Wright <chrisw@sous-sol.org>
parent c8e340f9
...@@ -641,10 +641,14 @@ int mls_export_cat(const struct context *context, ...@@ -641,10 +641,14 @@ int mls_export_cat(const struct context *context,
int rc = -EPERM; int rc = -EPERM;
if (!selinux_mls_enabled) { if (!selinux_mls_enabled) {
*low = NULL; if (low != NULL) {
*low_len = 0; *low = NULL;
*high = NULL; *low_len = 0;
*high_len = 0; }
if (high != NULL) {
*high = NULL;
*high_len = 0;
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment