All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] Fix error path in mls_semantic_level_expand().
@ 2015-02-22 15:12 Chris PeBenito
  2015-02-23 13:20 ` Steve Lawrence
  0 siblings, 1 reply; 2+ messages in thread
From: Chris PeBenito @ 2015-02-22 15:12 UTC (permalink / raw)
  To: selinux

If the level contains a category that is not associated with a sensitivity,
the code correctly detects the condition, but does not return an error.

Signed-off-by: Chris PeBenito <cpebenito@tresys.com>
---
 libsepol/src/expand.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libsepol/src/expand.c b/libsepol/src/expand.c
index 467f7a7..3193ef5 100644
--- a/libsepol/src/expand.c
+++ b/libsepol/src/expand.c
@@ -914,10 +914,11 @@ int mls_semantic_level_expand(mls_semantic_level_t * sl, mls_level_t * l,
 		}
 		for (i = cat->low - 1; i < cat->high; i++) {
 			if (!ebitmap_get_bit(&levdatum->level->cat, i)) {
-				ERR(h, "Category %s can not be associate with "
+				ERR(h, "Category %s can not be associated with "
 				    "level %s",
 				    p->p_cat_val_to_name[i],
 				    p->p_sens_val_to_name[l->sens - 1]);
+				return -1;
 			}
 			if (ebitmap_set_bit(&l->cat, i, 1)) {
 				ERR(h, "Out of memory!");
-- 
2.3.0

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

end of thread, other threads:[~2015-02-23 13:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-22 15:12 [PATCH 1/1] Fix error path in mls_semantic_level_expand() Chris PeBenito
2015-02-23 13:20 ` Steve Lawrence

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.