summaryrefslogtreecommitdiff
path: root/security/apparmor/include/perms.h
diff options
context:
space:
mode:
authorTyler Hicks <tyhicks@canonical.com>2018-07-06 08:25:00 +0300
committerJohn Johansen <john.johansen@canonical.com>2018-07-20 02:24:43 +0300
commit7f3ebcf2b1395e0248e56146041e1e5625fd2f23 (patch)
tree51d693e57cc5734aee692b1cebab08acd1aab511 /security/apparmor/include/perms.h
parentfb7d1bcf1602b46f37ada72178516c01a250e434 (diff)
downloadlinux-7f3ebcf2b1395e0248e56146041e1e5625fd2f23.tar.xz
apparmor: Check buffer bounds when mapping permissions mask
Don't read past the end of the buffer containing permissions characters or write past the end of the destination string. Detected by CoverityScan CID#1415361, 1415376 ("Out-of-bounds access") Fixes: e53cfe6c7caa ("apparmor: rework perm mapping to a slightly broader set") Signed-off-by: Tyler Hicks <tyhicks@canonical.com> Acked-by: Serge Hallyn <serge@hallyn.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/include/perms.h')
-rw-r--r--security/apparmor/include/perms.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/security/apparmor/include/perms.h b/security/apparmor/include/perms.h
index 38aa6247d00f..b94ec114d1a4 100644
--- a/security/apparmor/include/perms.h
+++ b/security/apparmor/include/perms.h
@@ -137,7 +137,8 @@ extern struct aa_perms allperms;
xcheck(fn_for_each((L1), (P), (FN1)), fn_for_each((L2), (P), (FN2)))
-void aa_perm_mask_to_str(char *str, const char *chrs, u32 mask);
+void aa_perm_mask_to_str(char *str, size_t str_size, const char *chrs,
+ u32 mask);
void aa_audit_perm_names(struct audit_buffer *ab, const char * const *names,
u32 mask);
void aa_audit_perm_mask(struct audit_buffer *ab, u32 mask, const char *chrs,