1
Index: b/security/apparmor/main.c
2
===================================================================
3
--- a/security/apparmor/main.c
4
+++ b/security/apparmor/main.c
5
@@ -768,16 +768,17 @@ repeat:
8
static struct aa_profile *
9
-aa_register_find(const char *name, int mandatory, int complain)
10
+aa_register_find(struct aa_profile *profile, const char *name, int mandatory,
13
- struct aa_profile *profile;
14
+ struct aa_profile *new_profile;
16
/* Locate new profile */
17
- profile = aa_find_profile(name);
19
+ new_profile = aa_find_profile(name);
21
AA_DEBUG("%s: setting profile %s\n",
22
- __FUNCTION__, profile->name);
23
- } else if (mandatory) {
24
+ __FUNCTION__, new_profile->name);
25
+ } else if (mandatory && profile) {
27
LOG_HINT(profile, GFP_KERNEL, HINT_MANDPROF,
28
"image=%s pid=%d profile=%s active=%s\n",
29
@@ -803,7 +804,7 @@ aa_register_find(const char *name, int m
38
@@ -860,7 +861,8 @@ repeat:
39
AA_DEBUG("%s: PROFILE %s\n",
42
- new_profile = aa_register_find(filename, 1,
43
+ new_profile = aa_register_find(profile,
48
@@ -897,7 +899,7 @@ repeat:
51
/* Unconfined task, load profile if it exists */
52
- new_profile = aa_register_find(filename, 0, 0);
53
+ new_profile = aa_register_find(NULL, filename, 0, 0);
54
if (new_profile == NULL)
57
@@ -926,7 +928,7 @@ repeat:
58
* Cases 2 and 3 are marked as requiring secure exec
59
* (unless policy specified "unsafe exec")
61
- if (new_profile && !(exec_mode & AA_EXEC_UNSAFE)) {
62
+ if (!(exec_mode & AA_EXEC_UNSAFE)) {
63
unsigned long bprm_flags;
65
bprm_flags = AA_SECURE_EXEC_NEEDED;