1
Rename get_aa_profile to aa_dup_profile: this better matches what
2
the function does -- "grab another handle" to the profile by
3
bumping the reference count.
5
Index: b/security/apparmor/inline.h
6
===================================================================
7
--- a/security/apparmor/inline.h
8
+++ b/security/apparmor/inline.h
10
#include <linux/sched.h>
13
- * get_aa_profile - increment refcount on profile @p
14
+ * aa_dup_profile - increment refcount on profile @p
17
-static inline struct aa_profile *get_aa_profile(struct aa_profile *p)
18
+static inline struct aa_profile *aa_dup_profile(struct aa_profile *p)
21
kref_get(&(BASE_PROFILE(p)->count));
22
@@ -69,7 +69,7 @@ static inline struct aa_profile *get_tas
23
struct aa_profile *active;
26
- active = get_aa_profile(get_task_activeptr_rcu(tsk));
27
+ active = aa_dup_profile(get_task_activeptr_rcu(tsk));
31
@@ -101,7 +101,7 @@ static inline void aa_switch(struct aa_t
32
struct aa_profile *oldactive = cxt->active;
35
- rcu_assign_pointer(cxt->active, get_aa_profile(newactive));
36
+ rcu_assign_pointer(cxt->active, aa_dup_profile(newactive));
37
cxt->caps_logged = CAP_EMPTY_SET;
38
put_aa_profile(oldactive);
40
@@ -211,7 +211,7 @@ static inline struct aa_profile *__aa_fi
41
list_for_each_entry(p, head, list) {
42
if (!strcmp(p->name, name)) {
43
/* return refcounted object */
44
- p = get_aa_profile(p);
45
+ p = aa_dup_profile(p);
48
AA_DEBUG("%s: skipping %s\n", __FUNCTION__, p->name);
49
Index: b/security/apparmor/main.c
50
===================================================================
51
--- a/security/apparmor/main.c
52
+++ b/security/apparmor/main.c
53
@@ -872,7 +872,7 @@ int aa_register(struct linux_binprm *bpr
54
* describing mode to execute image in.
55
* Drop into null-profile (disabling secure exec).
57
- newprofile = get_aa_profile(null_complain_profile);
58
+ newprofile = aa_dup_profile(null_complain_profile);
61
AA_WARN("%s: Rejecting exec(2) of image '%s'. "
62
@@ -905,7 +905,7 @@ find_profile:
64
BASE_PROFILE(active)->name, active->name);
66
- newprofile = get_aa_profile(null_complain_profile);
67
+ newprofile = aa_dup_profile(null_complain_profile);
69
AA_WARN("REJECTING exec(2) of image '%s'. "
70
"Profile mandatory and not found "
71
@@ -995,7 +995,7 @@ apply_profile:
72
if (newprofile && unlikely(newprofile->isstale)) {
73
WARN_ON(newprofile == null_complain_profile);
75
- /* drop refcnt obtained from earlier get_aa_profile */
76
+ /* drop refcnt obtained from earlier aa_dup_profile */
77
put_aa_profile(newprofile);
79
newprofile = aa_profilelist_find(filename);
80
Index: b/security/apparmor/procattr.c
81
===================================================================
82
--- a/security/apparmor/procattr.c
83
+++ b/security/apparmor/procattr.c
84
@@ -281,7 +281,7 @@ int aa_setprocattr_setprofile(struct tas
85
if (unlikely(profile->isstale)) {
86
WARN_ON(profile == null_complain_profile);
88
- /* drop refcnt obtained from earlier get_aa_profile */
89
+ /* drop refcnt obtained from earlier aa_dup_profile */
90
put_aa_profile(profile);
91
profile = aa_profilelist_find(name);
93
Index: b/security/apparmor/module_interface.c
94
===================================================================
95
--- a/security/apparmor/module_interface.c
96
+++ b/security/apparmor/module_interface.c
97
@@ -110,7 +110,7 @@ static inline void task_replace(struct a
98
nactive = __aa_find_profile(cxt->active->name, &new->sub);
101
- nactive = get_aa_profile(new->null_profile);
102
+ nactive = aa_dup_profile(new->null_profile);
104
aa_switch(cxt, nactive);
105
put_aa_profile(nactive);
106
@@ -560,7 +560,7 @@ ssize_t aa_file_prof_repl(void *udata, s
107
* Grab extra reference on new_profile to prevent this
110
- get_aa_profile(data.new_profile);
111
+ aa_dup_profile(data.new_profile);
113
data.old_profile = aa_profilelist_replace(data.new_profile);