From: Ron Yorston Date: Wed, 19 Apr 2006 05:21:04 +0000 (-0700) Subject: [PATCH] selinux: Fix MLS compatibility off-by-one bug X-Git-Tag: v2.6.16.28-rc1~140 X-Git-Url: https://git.kernelconcepts.de/?a=commitdiff_plain;h=00905d543081c11b3823577b951e22fdf3260477;p=karo-tx-linux.git [PATCH] selinux: Fix MLS compatibility off-by-one bug Fix an off-by-one error in the MLS compatibility code that was causing contexts with a MLS suffix to be rejected, preventing sharing partitions between FC4 and FC5. Bug reported in https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=188068 Signed-off-by: Stephen Smalley Acked-by: James Morris Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- diff --git a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c index 640d0bfdbc68..84047f69f9c1 100644 --- a/security/selinux/ss/mls.c +++ b/security/selinux/ss/mls.c @@ -264,7 +264,7 @@ int mls_context_to_sid(char oldc, if (!selinux_mls_enabled) { if (def_sid != SECSID_NULL && oldc) - *scontext += strlen(*scontext); + *scontext += strlen(*scontext)+1; return 0; }