]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - security/apparmor/match.c
apparmor: reduce rcu_read_lock scope for aa_file_perm mediation
[linux.git] / security / apparmor / match.c
index 55f2ee505a019411de885560a5e80f79a23d0e5b..21fad8f48bc3304a547e14cdb8f0d50169112080 100644 (file)
@@ -620,8 +620,8 @@ unsigned int aa_dfa_matchn_until(struct aa_dfa *dfa, unsigned int start,
 
 #define inc_wb_pos(wb)                                         \
 do {                                                           \
-       wb->pos = (wb->pos + 1) & (wb->size - 1);               \
-       wb->len = (wb->len + 1) & (wb->size - 1);               \
+       wb->pos = (wb->pos + 1) & (WB_HISTORY_SIZE - 1);                \
+       wb->len = (wb->len + 1) & (WB_HISTORY_SIZE - 1);                \
 } while (0)
 
 /* For DFAs that don't support extended tagging of states */
@@ -640,7 +640,7 @@ static bool is_loop(struct match_workbuf *wb, unsigned int state,
                        return true;
                }
                if (pos == 0)
-                       pos = wb->size;
+                       pos = WB_HISTORY_SIZE;
                pos--;
        }