summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2022-01-25 00:37:42 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-25 11:15:35 +0200
commit36f846a8422455a876cdea9e367594eefdb6ebf5 (patch)
tree9893509cf059d85edaa6793bc39b7d642e76e5d7 /security
parentf6115835c6a09fe48979b1d2cc9007824f5db16a (diff)
apparmor: Fix failed mount permission check error message
commit ec240b5905bbb09a03dccffee03062cf39e38dc2 upstream. When the mount check fails due to a permission check failure instead of explicitly at one of the subcomponent checks, AppArmor is reporting a failure in the flags match. However this is not true and AppArmor can not attribute the error at this point to any particular component, and should only indicate the mount failed due to missing permissions. Fixes: 2ea3ffb7782a ("apparmor: add mount mediation") Signed-off-by: John Johansen <john.johansen@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'security')
-rw-r--r--security/apparmor/mount.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/security/apparmor/mount.c b/security/apparmor/mount.c
index c1da22482bfb..ec15bee2046c 100644
--- a/security/apparmor/mount.c
+++ b/security/apparmor/mount.c
@@ -232,7 +232,8 @@ static const char * const mnt_info_table[] = {
"failed srcname match",
"failed type match",
"failed flags match",
- "failed data match"
+ "failed data match",
+ "failed perms check"
};
/*
@@ -287,8 +288,8 @@ static int do_match_mnt(struct aa_dfa *dfa, unsigned int start,
return 0;
}
- /* failed at end of flags match */
- return 4;
+ /* failed at perms check, don't confuse with flags match */
+ return 6;
}