~ubuntu-branches/ubuntu/wily/apparmor/wily

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2011-04-27 10:38:07 UTC
  • mfrom: (5.1.118 natty)
  • Revision ID: james.westby@ubuntu.com-20110427103807-ym3rhwys6o84ith0
Tags: 2.6.1-2
debian/copyright: clarify for some full organization names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Rename put_aa_profile to aa_put_profile for consistency.
2
 
 
3
 
Index: b/security/apparmor/apparmorfs.c
4
 
===================================================================
5
 
--- a/security/apparmor/apparmorfs.c
6
 
+++ b/security/apparmor/apparmorfs.c
7
 
@@ -170,7 +170,7 @@ static char *aa_simple_write_to_buffer(c
8
 
                        "profile %s active %s)\n",
9
 
                        msg, current->comm, current->pid,
10
 
                        BASE_PROFILE(profile)->name, profile->name);
11
 
-               put_aa_profile(profile);
12
 
+               aa_put_profile(profile);
13
 
 
14
 
                data = ERR_PTR(-EPERM);
15
 
                goto out;
16
 
Index: b/security/apparmor/inline.h
17
 
===================================================================
18
 
--- a/security/apparmor/inline.h
19
 
+++ b/security/apparmor/inline.h
20
 
@@ -25,10 +25,10 @@ static inline struct aa_profile *aa_dup_
21
 
 }
22
 
 
23
 
 /**
24
 
- * put_aa_profile - decrement refcount on profile @p
25
 
+ * aa_put_profile - decrement refcount on profile @p
26
 
  * @p: profile
27
 
  */
28
 
-static inline void put_aa_profile(struct aa_profile *p)
29
 
+static inline void aa_put_profile(struct aa_profile *p)
30
 
 {
31
 
        if (p)
32
 
                kref_put(&BASE_PROFILE(p)->count, free_aa_profile_kref);
33
 
@@ -72,7 +72,7 @@ static inline void aa_switch_to_profile(
34
 
        cxt->caps_logged = CAP_EMPTY_SET;
35
 
        cxt->hat_magic = hat_magic;
36
 
        rcu_assign_pointer(cxt->profile, aa_dup_profile(newactive));
37
 
-       put_aa_profile(old);
38
 
+       aa_put_profile(old);
39
 
 }
40
 
 
41
 
 /**
42
 
Index: b/security/apparmor/list.c
43
 
===================================================================
44
 
--- a/security/apparmor/list.c
45
 
+++ b/security/apparmor/list.c
46
 
@@ -60,7 +60,7 @@ int aa_profilelist_add(struct aa_profile
47
 
        write_lock(&profile_lock);
48
 
        old_profile = __aa_find_profile(profile->name, &profile_list);
49
 
        if (old_profile) {
50
 
-               put_aa_profile(old_profile);
51
 
+               aa_put_profile(old_profile);
52
 
                goto out;
53
 
        }
54
 
 
55
 
@@ -126,7 +126,7 @@ struct aa_profile *aa_profilelist_replac
56
 
                oldprofile->isstale = 1;
57
 
 
58
 
                /* __aa_find_profile incremented count, so adjust down */
59
 
-               put_aa_profile(oldprofile);
60
 
+               aa_put_profile(oldprofile);
61
 
        }
62
 
 
63
 
        list_add(&profile->list, &profile_list);
64
 
@@ -145,7 +145,7 @@ void aa_profilelist_release(void)
65
 
        write_lock(&profile_lock);
66
 
        list_for_each_entry_safe(p, tmp, &profile_list, list) {
67
 
                list_del_init(&p->list);
68
 
-               put_aa_profile(p);
69
 
+               aa_put_profile(p);
70
 
        }
71
 
        write_unlock(&profile_lock);
72
 
 }
73
 
Index: b/security/apparmor/lsm.c
74
 
===================================================================
75
 
--- a/security/apparmor/lsm.c
76
 
+++ b/security/apparmor/lsm.c
77
 
@@ -92,7 +92,7 @@ static int aa_reject_syscall(struct task
78
 
 
79
 
        if (profile) {
80
 
                error = aa_audit_syscallreject(profile, flags, name);
81
 
-               put_aa_profile(profile);
82
 
+               aa_put_profile(profile);
83
 
        }
84
 
 
85
 
        return error;
86
 
@@ -148,7 +148,7 @@ static int apparmor_capable(struct task_
87
 
                if (profile)
88
 
                        error = aa_capability(profile, cap);
89
 
 
90
 
-               put_aa_profile(profile);
91
 
+               aa_put_profile(profile);
92
 
        }
93
 
 
94
 
        return error;
95
 
@@ -233,7 +233,7 @@ static int apparmor_inode_mkdir(struct i
96
 
        if (profile)
97
 
                error = aa_perm_dir(profile, dentry, mnt, "mkdir", MAY_WRITE);
98
 
 
99
 
-       put_aa_profile(profile);
100
 
+       aa_put_profile(profile);
101
 
 
102
 
 out:
103
 
        return error;
104
 
@@ -253,7 +253,7 @@ static int apparmor_inode_rmdir(struct i
105
 
        if (profile)
106
 
                error = aa_perm_dir(profile, dentry, mnt, "rmdir", MAY_WRITE);
107
 
 
108
 
-       put_aa_profile(profile);
109
 
+       aa_put_profile(profile);
110
 
 
111
 
 out:
112
 
        return error;
113
 
@@ -269,7 +269,7 @@ static int aa_permission(struct inode *i
114
 
 
115
 
                if (profile)
116
 
                        error = aa_perm(profile, dentry, mnt, mask, leaf);
117
 
-               put_aa_profile(profile);
118
 
+               aa_put_profile(profile);
119
 
        }
120
 
        return error;
121
 
 }
122
 
@@ -297,7 +297,7 @@ static int apparmor_inode_link(struct de
123
 
                error = aa_link(profile, new_dentry, new_mnt,
124
 
                                old_dentry, old_mnt);
125
 
 
126
 
-       put_aa_profile(profile);
127
 
+       aa_put_profile(profile);
128
 
 
129
 
 out:
130
 
        return error;
131
 
@@ -347,7 +347,7 @@ static int apparmor_inode_rename(struct 
132
 
                                        MAY_WRITE, 1);
133
 
        }
134
 
 
135
 
-       put_aa_profile(profile);
136
 
+       aa_put_profile(profile);
137
 
 
138
 
 out:
139
 
        return error;
140
 
@@ -395,7 +395,7 @@ static int apparmor_inode_setattr(struct
141
 
                if (profile)
142
 
                        error = aa_attr(profile, dentry, mnt, iattr);
143
 
 
144
 
-               put_aa_profile(profile);
145
 
+               aa_put_profile(profile);
146
 
        }
147
 
 
148
 
 out:
149
 
@@ -414,7 +414,7 @@ static int aa_xattr_permission(struct de
150
 
                if (profile)
151
 
                        error = aa_perm_xattr(profile, dentry, mnt, name,
152
 
                                              operation, mask);
153
 
-               put_aa_profile(profile);
154
 
+               aa_put_profile(profile);
155
 
        }
156
 
 
157
 
        return error;
158
 
@@ -522,7 +522,7 @@ static int apparmor_getprocattr(struct t
159
 
 
160
 
        profile = aa_get_profile(p);
161
 
        error = aa_getprocattr(profile, str, size);
162
 
-       put_aa_profile(profile);
163
 
+       aa_put_profile(profile);
164
 
 
165
 
 out:
166
 
        return error;
167
 
@@ -614,7 +614,7 @@ static int apparmor_setprocattr(struct t
168
 
 
169
 
                        error = -EACCES;
170
 
                }
171
 
-               put_aa_profile(profile);
172
 
+               aa_put_profile(profile);
173
 
        } else {
174
 
                /* unknown operation */
175
 
                AA_WARN("%s: Unknown setprocattr command '%.*s' by task %s(%d) "
176
 
Index: b/security/apparmor/main.c
177
 
===================================================================
178
 
--- a/security/apparmor/main.c
179
 
+++ b/security/apparmor/main.c
180
 
@@ -258,7 +258,7 @@ fail:
181
 
  */
182
 
 void free_null_complain_profile(void)
183
 
 {
184
 
-       put_aa_profile(null_complain_profile);
185
 
+       aa_put_profile(null_complain_profile);
186
 
        null_complain_profile = NULL;
187
 
 }
188
 
 
189
 
@@ -1011,7 +1011,7 @@ apply_profile:
190
 
                        WARN_ON(newprofile == null_complain_profile);
191
 
 
192
 
                        /* drop refcnt obtained from earlier aa_dup_profile */
193
 
-                       put_aa_profile(newprofile);
194
 
+                       aa_put_profile(newprofile);
195
 
 
196
 
                        newprofile = aa_profilelist_find(filename);
197
 
 
198
 
@@ -1042,7 +1042,7 @@ apply_profile:
199
 
                }
200
 
 
201
 
                aa_switch_to_profile(cxt, newprofile, 0);
202
 
-               put_aa_profile(newprofile);
203
 
+               aa_put_profile(newprofile);
204
 
 
205
 
                if (complain && newprofile == null_complain_profile)
206
 
                        LOG_HINT(newprofile, GFP_ATOMIC, HINT_CHGPROF,
207
 
@@ -1055,7 +1055,7 @@ apply_profile:
208
 
 cleanup:
209
 
        aa_put_name(filename);
210
 
 
211
 
-       put_aa_profile(profile);
212
 
+       aa_put_profile(profile);
213
 
 
214
 
 out:
215
 
        return error;
216
 
@@ -1110,7 +1110,7 @@ static inline int do_change_hat(const ch
217
 
        if (sub) {
218
 
                /* change hat */
219
 
                aa_switch_to_profile(cxt, sub, hat_magic);
220
 
-               put_aa_profile(sub);
221
 
+               aa_put_profile(sub);
222
 
        } else {
223
 
                /* There is no such subprofile change to a NULL profile.
224
 
                 * The NULL profile grants no file access.
225
 
Index: b/security/apparmor/module_interface.c
226
 
===================================================================
227
 
--- a/security/apparmor/module_interface.c
228
 
+++ b/security/apparmor/module_interface.c
229
 
@@ -113,7 +113,7 @@ static inline void task_replace(struct a
230
 
                        nactive = aa_dup_profile(new->null_profile);
231
 
 
232
 
                aa_switch_to_profile(cxt, nactive, cxt->hat_magic);
233
 
-               put_aa_profile(nactive);
234
 
+               aa_put_profile(nactive);
235
 
        } else
236
 
                aa_switch_to_profile(cxt, new, cxt->hat_magic);
237
 
 }
238
 
@@ -508,7 +508,7 @@ ssize_t aa_file_prof_add(void *data, siz
239
 
        } else {
240
 
                AA_WARN("trying to add profile (%s) that already exists.\n",
241
 
                        profile->name);
242
 
-               put_aa_profile(profile);
243
 
+               aa_put_profile(profile);
244
 
                error = -EEXIST;
245
 
        }
246
 
 
247
 
@@ -572,11 +572,11 @@ ssize_t aa_file_prof_repl(void *udata, s
248
 
                aa_task_context_list_iterate(taskreplace_iter, (void *)&data);
249
 
 
250
 
                /* it's off global list, and we are done replacing */
251
 
-               put_aa_profile(data.old_profile);
252
 
+               aa_put_profile(data.old_profile);
253
 
        }
254
 
 
255
 
        /* release extra reference obtained above (race) */
256
 
-       put_aa_profile(data.new_profile);
257
 
+       aa_put_profile(data.new_profile);
258
 
 
259
 
        error = size;
260
 
 
261
 
@@ -607,7 +607,7 @@ ssize_t aa_file_prof_remove(const char *
262
 
                                             (void *)old_profile);
263
 
 
264
 
                /* drop reference obtained by aa_profilelist_remove */
265
 
-               put_aa_profile(old_profile);
266
 
+               aa_put_profile(old_profile);
267
 
        } else {
268
 
                AA_WARN("%s: trying to remove profile (%s) that "
269
 
                        "doesn't exist - skipping.\n", __FUNCTION__, name);
270
 
@@ -618,7 +618,7 @@ ssize_t aa_file_prof_remove(const char *
271
 
 }
272
 
 
273
 
 /**
274
 
- * free_aa_profile_kref - free aa_profile by kref (called by put_aa_profile)
275
 
+ * free_aa_profile_kref - free aa_profile by kref (called by aa_put_profile)
276
 
  * @kr: kref callback for freeing of a profile
277
 
  */
278
 
 void free_aa_profile_kref(struct kref *kr)
279
 
@@ -657,7 +657,7 @@ void free_aa_profile(struct aa_profile *
280
 
 
281
 
        aa_match_free(profile->file_rules);
282
 
 
283
 
-       /* use free_aa_profile instead of put_aa_profile to destroy the
284
 
+       /* use free_aa_profile instead of aa_put_profile to destroy the
285
 
         * null_profile, because the null_profile use the same reference
286
 
         * counting as hats, ie. the count goes to the base profile.
287
 
         */
288
 
@@ -665,7 +665,7 @@ void free_aa_profile(struct aa_profile *
289
 
        list_for_each_entry_safe(p, ptmp, &profile->sub, list) {
290
 
                list_del_init(&p->list);
291
 
                p->parent = NULL;
292
 
-               put_aa_profile(p);
293
 
+               aa_put_profile(p);
294
 
        }
295
 
 
296
 
        if (profile->name) {
297
 
Index: b/security/apparmor/procattr.c
298
 
===================================================================
299
 
--- a/security/apparmor/procattr.c
300
 
+++ b/security/apparmor/procattr.c
301
 
@@ -262,7 +262,7 @@ int aa_setprocattr_setprofile(struct tas
302
 
                                        name);
303
 
 
304
 
                                error = -ENOMEM;
305
 
-                               put_aa_profile(profile);
306
 
+                               aa_put_profile(profile);
307
 
 
308
 
                                goto out;
309
 
                        }
310
 
@@ -282,7 +282,7 @@ int aa_setprocattr_setprofile(struct tas
311
 
                        WARN_ON(profile == null_complain_profile);
312
 
 
313
 
                        /* drop refcnt obtained from earlier aa_dup_profile */
314
 
-                       put_aa_profile(profile);
315
 
+                       aa_put_profile(profile);
316
 
                        profile = aa_profilelist_find(name);
317
 
 
318
 
                        if (!profile) {
319
 
@@ -309,7 +309,7 @@ int aa_setprocattr_setprofile(struct tas
320
 
                        name);
321
 
 
322
 
                aa_switch_to_profile(cxt, profile, 0);
323
 
-               put_aa_profile(profile);
324
 
+               aa_put_profile(profile);
325
 
        }
326
 
 
327
 
        spin_unlock_irqrestore(&cxt_lock, flags);