~ubuntu-branches/ubuntu/raring/apparmor/raring

« back to all changes in this revision

Viewing changes to kernel-patches/for-mainline/rename-get_aa_profile.diff

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-03-23 16:42:01 UTC
  • Revision ID: james.westby@ubuntu.com-20070323164201-jkax6f0oku087b7l
Tags: upstream-2.0.1+510.dfsg
ImportĀ upstreamĀ versionĀ 2.0.1+510.dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.
 
4
 
 
5
Index: b/security/apparmor/inline.h
 
6
===================================================================
 
7
--- a/security/apparmor/inline.h
 
8
+++ b/security/apparmor/inline.h
 
9
@@ -13,10 +13,10 @@
 
10
 #include <linux/sched.h>
 
11
 
 
12
 /**
 
13
- * get_aa_profile - increment refcount on profile @p
 
14
+ * aa_dup_profile - increment refcount on profile @p
 
15
  * @p: profile
 
16
  */
 
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)
 
19
 {
 
20
        if (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;
 
24
 
 
25
        rcu_read_lock();
 
26
-       active = get_aa_profile(get_task_activeptr_rcu(tsk));
 
27
+       active = aa_dup_profile(get_task_activeptr_rcu(tsk));
 
28
        rcu_read_unlock();
 
29
 
 
30
        return active;
 
31
@@ -101,7 +101,7 @@ static inline void aa_switch(struct aa_t
 
32
        struct aa_profile *oldactive = cxt->active;
 
33
 
 
34
        /* noop if NULL */
 
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);
 
39
 }
 
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);
 
46
                        return p;
 
47
                } else {
 
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).
 
56
                 */
 
57
-               newprofile = get_aa_profile(null_complain_profile);
 
58
+               newprofile = aa_dup_profile(null_complain_profile);
 
59
                unsafe_exec = 1;
 
60
        } else {
 
61
                AA_WARN("%s: Rejecting exec(2) of image '%s'. "
 
62
@@ -905,7 +905,7 @@ find_profile:
 
63
                                current->pid,
 
64
                                BASE_PROFILE(active)->name, active->name);
 
65
 
 
66
-                       newprofile = get_aa_profile(null_complain_profile);
 
67
+                       newprofile = aa_dup_profile(null_complain_profile);
 
68
                } else {
 
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);
 
74
 
 
75
-                       /* drop refcnt obtained from earlier get_aa_profile */
 
76
+                       /* drop refcnt obtained from earlier aa_dup_profile */
 
77
                        put_aa_profile(newprofile);
 
78
 
 
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);
 
87
 
 
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);
 
92
 
 
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);
 
99
 
 
100
                if (!nactive)
 
101
-                       nactive = get_aa_profile(new->null_profile);
 
102
+                       nactive = aa_dup_profile(new->null_profile);
 
103
 
 
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
 
108
         */
 
109
 
 
110
-       get_aa_profile(data.new_profile);
 
111
+       aa_dup_profile(data.new_profile);
 
112
 
 
113
        data.old_profile = aa_profilelist_replace(data.new_profile);
 
114