apparmor: Fix an error code in verify_table_headers()
Subsystems (3)
PATCH 1/1 apparmor: Fix an error code in verify_table_headers()
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 <[email protected]>
security/apparmor/match.c +1 -1
@@ -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;
Quoted 7 lines · Dan Carpenter
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 <[email protected]>
ouch, and pulled into apparmor-next
Acked-by John Johansen <[email protected]>
Quoted 14 lines
security/apparmor/match.c +1
-1@@ -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;