1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * AppArmor security module
5 * Code to provide backwards compatibility with older policy versions,
6 * by converting/mapping older policy formats into the newer internal
9 * Copyright 2022 Canonical Ltd.
12 #ifndef __POLICY_COMPAT_H
13 #define __POLICY_COMPAT_H
17 #define K_ABI_MASK 0x3ff
18 #define FORCE_COMPLAIN_FLAG 0x800
19 #define VERSION_LT(X, Y) (((X) & K_ABI_MASK) < ((Y) & K_ABI_MASK))
20 #define VERSION_LE(X, Y) (((X) & K_ABI_MASK) <= ((Y) & K_ABI_MASK))
21 #define VERSION_GT(X, Y) (((X) & K_ABI_MASK) > ((Y) & K_ABI_MASK))
23 #define v5 5 /* base version */
24 #define v6 6 /* per entry policydb mediation check */
26 #define v8 8 /* full network masking */
27 #define v9 9 /* xbits are used as permission bits in policydb */
29 int aa_compat_map_xmatch(struct aa_policydb
*policy
);
30 int aa_compat_map_policy(struct aa_policydb
*policy
, u32 version
);
31 int aa_compat_map_file(struct aa_policydb
*policy
);
33 #endif /* __POLICY_COMPAT_H */