kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] apparmor: issue with ns name without a following profile
@ 2010-08-07 11:50 Dan Carpenter
  2010-08-12 15:15 ` John Johansen
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-08-07 11:50 UTC (permalink / raw)
  To: John Johansen
  Cc: James Morris, linux-security-module, linux-kernel,
	kernel-janitors

If we have a ns name without a following profile then in the original
code it did "*ns_name = &name[1];".  "name" is NULL so "*ns_name" is
0x1.  That isn't useful and could cause an oops when this function is
called from aa_remove_profiles(). 

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
I'm not very familiar with this code and I haven't tested my fix. 
Sorry.  Please review carefully.

diff --git a/security/apparmor/lib.c b/security/apparmor/lib.c
index 6e85cdb..da34011 100644
--- a/security/apparmor/lib.c
+++ b/security/apparmor/lib.c
@@ -44,10 +44,12 @@ char *aa_split_fqname(char *fqname, char **ns_name)
 			/* overwrite ':' with \0 */
 			*split = 0;
 			name = skip_spaces(split + 1);
-		} else
+			*ns_name = &name[1];
+		} else {
 			/* a ns name without a following profile is allowed */
+			*ns_name = &name[1];
 			name = NULL;
-		*ns_name = &name[1];
+		}
 	}
 	if (name && *name = 0)
 		name = NULL;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-12 15:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-07 11:50 [patch] apparmor: issue with ns name without a following profile Dan Carpenter
2010-08-12 15:15 ` John Johansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).