hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/security/apparmor/include/match.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * AppArmor security module
34 *
....@@ -5,11 +6,6 @@
56 *
67 * Copyright (C) 1998-2008 Novell/SUSE
78 * Copyright 2009-2012 Canonical Ltd.
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU General Public License as
11
- * published by the Free Software Foundation, version 2 of the
12
- * License.
139 */
1410
1511 #ifndef __AA_MATCH_H
....@@ -41,6 +37,10 @@
4137
4238 #define YYTH_MAGIC 0x1B5E783D
4339 #define YYTH_FLAG_DIFF_ENCODE 1
40
+#define YYTH_FLAG_OOB_TRANS 2
41
+#define YYTH_FLAGS (YYTH_FLAG_DIFF_ENCODE | YYTH_FLAG_OOB_TRANS)
42
+
43
+#define MAX_OOB_SUPPORTED 1
4444
4545 struct table_set_header {
4646 u32 th_magic; /* YYTH_MAGIC */
....@@ -98,6 +98,7 @@
9898 struct aa_dfa {
9999 struct kref count;
100100 u16 flags;
101
+ u32 max_oob;
101102 struct table_header *tables[YYTD_ID_TSIZE];
102103 };
103104
....@@ -131,6 +132,8 @@
131132 const char *str);
132133 unsigned int aa_dfa_next(struct aa_dfa *dfa, unsigned int state,
133134 const char c);
135
+unsigned int aa_dfa_outofband_transition(struct aa_dfa *dfa,
136
+ unsigned int state);
134137 unsigned int aa_dfa_match_until(struct aa_dfa *dfa, unsigned int start,
135138 const char *str, const char **retpos);
136139 unsigned int aa_dfa_matchn_until(struct aa_dfa *dfa, unsigned int start,
....@@ -138,7 +141,7 @@
138141
139142 void aa_dfa_free_kref(struct kref *kref);
140143
141
-#define WB_HISTORY_SIZE 8
144
+#define WB_HISTORY_SIZE 24
142145 struct match_workbuf {
143146 unsigned int count;
144147 unsigned int pos;
....@@ -151,7 +154,6 @@
151154 .count = 0, \
152155 .pos = 0, \
153156 .len = 0, \
154
- .size = WB_HISTORY_SIZE, \
155157 }
156158
157159 unsigned int aa_dfa_leftmatch(struct aa_dfa *dfa, unsigned int start,
....@@ -186,5 +188,9 @@
186188
187189 #define MATCH_FLAG_DIFF_ENCODE 0x80000000
188190 #define MARK_DIFF_ENCODE 0x40000000
191
+#define MATCH_FLAG_OOB_TRANSITION 0x20000000
192
+#define MATCH_FLAGS_MASK 0xff000000
193
+#define MATCH_FLAGS_VALID (MATCH_FLAG_DIFF_ENCODE | MATCH_FLAG_OOB_TRANSITION)
194
+#define MATCH_FLAGS_INVALID (MATCH_FLAGS_MASK & ~MATCH_FLAGS_VALID)
189195
190196 #endif /* __AA_MATCH_H */