All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] apparmor: Fix an error code in verify_table_headers()
@ 2018-03-19  9:12 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2018-03-19  9:12 UTC (permalink / raw)
  To: linux-security-module

We accidentally return a positive EPROTO instead of a negative -EPROTO.
Since 71 is not an error pointer, that means it eventually results in an
Oops in the caller.

Fixes: d901d6a298dc ("apparmor: dfa split verification of table headers")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/security/apparmor/match.c b/security/apparmor/match.c
index dd4c995c5e25..280eba082c7b 100644
--- a/security/apparmor/match.c
+++ b/security/apparmor/match.c
@@ -198,7 +198,7 @@ static int verify_table_headers(struct table_header **tables, int flags)
 static int verify_dfa(struct aa_dfa *dfa)
 {
 	size_t i, state_count, trans_count;
-	int error = EPROTO;
+	int error = -EPROTO;
 
 	state_count = dfa->tables[YYTD_ID_BASE]->td_lolen;
 	trans_count = dfa->tables[YYTD_ID_NXT]->td_lolen;

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

end of thread, other threads:[~2018-03-24  0:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-19  9:12 [PATCH] apparmor: Fix an error code in verify_table_headers() Dan Carpenter
2018-03-19  9:12 ` Dan Carpenter
2018-03-24  0:27 ` John Johansen
2018-03-24  0:27   ` John Johansen

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.