lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 7 Aug 2010 13:50:38 +0200
From:	Dan Carpenter <error27@...il.com>
To:	John Johansen <john.johansen@...onical.com>
Cc:	James Morris <jmorris@...ei.org>,
	linux-security-module@...r.kernel.org,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [patch] apparmor: issue with ns name without a following profile

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@...il.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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ