All of lore.kernel.org
 help / color / mirror / Atom feed
* libsepol/src/conditional.c:cond_evaluate_expr()
@ 2006-03-06 21:41 Serge E. Hallyn
  2006-03-07  1:57 ` libsepol/src/link.c:copy_avrule_list( ) Ivan Gyurdiev
  2006-03-08 14:02 ` libsepol/src/conditional.c:cond_evaluate_expr() Stephen Smalley
  0 siblings, 2 replies; 7+ messages in thread
From: Serge E. Hallyn @ 2006-03-06 21:41 UTC (permalink / raw)
  To: SELinux

Hi,

just doing a quick update static analysis scan of the nsa/selinux-usr
sources.  Most of the output in libsepol seems like the same false
positives it used to get, but I'm worried about cond_evaluate_expr.

It is supposed to return -1 on error, but as is, if the second arg
(expr) is passed in NULL, the value returned is truly undefined -
it is just taken off the stack.

Patch appended, in case this is deemed to really be a danger.

thanks,
-serge

Index: libsepol/src/conditional.c
===================================================================
--- libsepol.orig/src/conditional.c	2005-10-13 12:06:06.000000000 -0500
+++ libsepol/src/conditional.c	2006-03-06 15:40:16.000000000 -0600
@@ -191,6 +191,8 @@ int cond_evaluate_expr(policydb_t *p, co
 	int s[COND_EXPR_MAXDEPTH];
 	int sp = -1;
 
+	s[0] = -1;
+
 	for (cur = expr; cur != NULL; cur = cur->next) {
 		switch (cur->expr_type) {
 		case COND_BOOL:

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

end of thread, other threads:[~2006-03-08 14:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-06 21:41 libsepol/src/conditional.c:cond_evaluate_expr() Serge E. Hallyn
2006-03-07  1:57 ` libsepol/src/link.c:copy_avrule_list( ) Ivan Gyurdiev
2006-03-08 14:05   ` Stephen Smalley
2006-03-08 14:05     ` Ivan Gyurdiev
2006-03-08 14:40       ` Stephen Smalley
2006-03-08 14:48         ` Joshua Brindle
2006-03-08 14:02 ` libsepol/src/conditional.c:cond_evaluate_expr() Stephen Smalley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.