summaryrefslogtreecommitdiffstats
path: root/security/apparmor/match.c
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2019-05-31 15:54:54 +0200
committerJohn Johansen <john.johansen@canonical.com>2019-06-20 19:33:31 +0200
commit136db994852a9b405ac1074de0e7a1c4c840b8ee (patch)
tree361f1d713b06407ebb105a8ee0ea7edb9e36cfdb /security/apparmor/match.c
parentapparmor: Switch to GFP_KERNEL where possible (diff)
downloadlinux-136db994852a9b405ac1074de0e7a1c4c840b8ee.tar.xz
linux-136db994852a9b405ac1074de0e7a1c4c840b8ee.zip
apparmor: increase left match history buffer size
There have been cases reported where a history buffer size of 8 was not enough to resolve conflict overlaps. Increase the buffer to and get rid of the size element which is currently just storing the constant WB_HISTORY_SIZE. Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/match.c')
-rw-r--r--security/apparmor/match.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/security/apparmor/match.c b/security/apparmor/match.c
index 55f2ee505a01..21fad8f48bc3 100644
--- a/security/apparmor/match.c
+++ b/security/apparmor/match.c
@@ -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--;
}