apparmor: exec should not be returning ENOENT when it denies
authorJohn Johansen <john.johansen@canonical.com>
Fri, 25 Jul 2014 11:02:03 +0000 (04:02 -0700)
committerWilly Tarreau <w@1wt.eu>
Tue, 20 Jun 2017 12:04:11 +0000 (14:04 +0200)
commit 9049a7922124d843a2cd26a02b1d00a17596ec0c upstream.

The current behavior is confusing as it causes exec failures to report
the executable is missing instead of identifying that apparmor
caused the failure.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Willy Tarreau <w@1wt.eu>
security/apparmor/domain.c

index 859abdaac1eafb62fddb202eb6fcdf3777e9daa2..8405a0428b67c150e3c4a47e787f3d1d10d8d0a3 100644 (file)
@@ -441,7 +441,7 @@ int apparmor_bprm_set_creds(struct linux_binprm *bprm)
                                new_profile = aa_get_profile(ns->unconfined);
                                info = "ux fallback";
                        } else {
-                               error = -ENOENT;
+                               error = -EACCES;
                                info = "profile not found";
                        }
                }