.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * AppArmor security module |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * |
---|
6 | 7 | * Copyright (C) 1998-2008 Novell/SUSE |
---|
7 | 8 | * 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. |
---|
13 | 9 | */ |
---|
14 | 10 | |
---|
15 | 11 | #ifndef __AA_MATCH_H |
---|
.. | .. |
---|
41 | 37 | |
---|
42 | 38 | #define YYTH_MAGIC 0x1B5E783D |
---|
43 | 39 | #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 |
---|
44 | 44 | |
---|
45 | 45 | struct table_set_header { |
---|
46 | 46 | u32 th_magic; /* YYTH_MAGIC */ |
---|
.. | .. |
---|
98 | 98 | struct aa_dfa { |
---|
99 | 99 | struct kref count; |
---|
100 | 100 | u16 flags; |
---|
| 101 | + u32 max_oob; |
---|
101 | 102 | struct table_header *tables[YYTD_ID_TSIZE]; |
---|
102 | 103 | }; |
---|
103 | 104 | |
---|
.. | .. |
---|
131 | 132 | const char *str); |
---|
132 | 133 | unsigned int aa_dfa_next(struct aa_dfa *dfa, unsigned int state, |
---|
133 | 134 | const char c); |
---|
| 135 | +unsigned int aa_dfa_outofband_transition(struct aa_dfa *dfa, |
---|
| 136 | + unsigned int state); |
---|
134 | 137 | unsigned int aa_dfa_match_until(struct aa_dfa *dfa, unsigned int start, |
---|
135 | 138 | const char *str, const char **retpos); |
---|
136 | 139 | unsigned int aa_dfa_matchn_until(struct aa_dfa *dfa, unsigned int start, |
---|
.. | .. |
---|
138 | 141 | |
---|
139 | 142 | void aa_dfa_free_kref(struct kref *kref); |
---|
140 | 143 | |
---|
141 | | -#define WB_HISTORY_SIZE 8 |
---|
| 144 | +#define WB_HISTORY_SIZE 24 |
---|
142 | 145 | struct match_workbuf { |
---|
143 | 146 | unsigned int count; |
---|
144 | 147 | unsigned int pos; |
---|
.. | .. |
---|
151 | 154 | .count = 0, \ |
---|
152 | 155 | .pos = 0, \ |
---|
153 | 156 | .len = 0, \ |
---|
154 | | - .size = WB_HISTORY_SIZE, \ |
---|
155 | 157 | } |
---|
156 | 158 | |
---|
157 | 159 | unsigned int aa_dfa_leftmatch(struct aa_dfa *dfa, unsigned int start, |
---|
.. | .. |
---|
186 | 188 | |
---|
187 | 189 | #define MATCH_FLAG_DIFF_ENCODE 0x80000000 |
---|
188 | 190 | #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) |
---|
189 | 195 | |
---|
190 | 196 | #endif /* __AA_MATCH_H */ |
---|