summaryrefslogtreecommitdiff
path: root/security/apparmor/include
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2025-08-01 02:21:44 -0700
committerJohn Johansen <john.johansen@canonical.com>2026-01-22 04:56:39 -0800
commitc140dcd1246bfe705921ca881bbb247ff1ba2bca (patch)
treec426b1ae116cfe5a55e404ad6f0dfc74e8df7cb2 /security/apparmor/include
parent6fc367bfd4c8886e6b1742aabbd1c0bdc310db3a (diff)
apparmor: make str table more generic and be able to have multiple entries
The strtable is currently limited to a single entry string on unpack even though domain has the concept of multiple entries within it. Make this a reality as it will be used for tags and more advanced domain transitions. Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/include')
-rw-r--r--security/apparmor/include/lib.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/security/apparmor/include/lib.h b/security/apparmor/include/lib.h
index 444197075fd6..194be85e7fff 100644
--- a/security/apparmor/include/lib.h
+++ b/security/apparmor/include/lib.h
@@ -30,6 +30,7 @@ extern struct aa_dfa *stacksplitdfa;
#define DEBUG_DOMAIN 4
#define DEBUG_POLICY 8
#define DEBUG_INTERFACE 0x10
+#define DEBUG_UNPACK 0x40
#define DEBUG_ALL 0x1f /* update if new DEBUG_X added */
#define DEBUG_PARSE_ERROR (-1)
@@ -119,13 +120,19 @@ static inline bool path_mediated_fs(struct dentry *dentry)
return !(dentry->d_sb->s_flags & SB_NOUSER);
}
+struct aa_str_table_ent {
+ int count;
+ int size;
+ char *strs;
+};
+
struct aa_str_table {
int size;
- char **table;
+ struct aa_str_table_ent *table;
};
-void aa_free_str_table(struct aa_str_table *table);
bool aa_resize_str_table(struct aa_str_table *t, int newsize, gfp_t gfp);
+void aa_destroy_str_table(struct aa_str_table *table);
struct counted_str {
struct kref count;