diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2010-01-26 06:45:27 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-01-26 16:20:48 -0500 |
commit | 8e2d39a1665e680c095545993aac2fcac6916eb9 (patch) | |
tree | 41687f7e7f4fb37416b7948b6d2e09d0a383459b /security/tomoyo/file.c | |
parent | 7d52a155e38d5a165759dbbee656455861bf7801 (diff) |
TOMOYO: Remove usage counter for temporary memory.
TOMOYO was using own memory usage counter for detecting memory leak.
But as kernel 2.6.31 introduced memory leak detection mechanism
( CONFIG_DEBUG_KMEMLEAK ), we no longer need to have own counter.
We remove usage counter for memory used for permission checks, but we keep
usage counter for memory used for policy so that we can apply quota.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo/file.c')
-rw-r--r-- | security/tomoyo/file.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/security/tomoyo/file.c b/security/tomoyo/file.c index cfcb096ee97a..24af081f1af9 100644 --- a/security/tomoyo/file.c +++ b/security/tomoyo/file.c | |||
@@ -150,7 +150,8 @@ static bool tomoyo_strendswith(const char *name, const char *tail) | |||
150 | static struct tomoyo_path_info *tomoyo_get_path(struct path *path) | 150 | static struct tomoyo_path_info *tomoyo_get_path(struct path *path) |
151 | { | 151 | { |
152 | int error; | 152 | int error; |
153 | struct tomoyo_path_info_with_data *buf = tomoyo_alloc(sizeof(*buf)); | 153 | struct tomoyo_path_info_with_data *buf = kzalloc(sizeof(*buf), |
154 | GFP_KERNEL); | ||
154 | 155 | ||
155 | if (!buf) | 156 | if (!buf) |
156 | return NULL; | 157 | return NULL; |
@@ -162,7 +163,7 @@ static struct tomoyo_path_info *tomoyo_get_path(struct path *path) | |||
162 | tomoyo_fill_path_info(&buf->head); | 163 | tomoyo_fill_path_info(&buf->head); |
163 | return &buf->head; | 164 | return &buf->head; |
164 | } | 165 | } |
165 | tomoyo_free(buf); | 166 | kfree(buf); |
166 | return NULL; | 167 | return NULL; |
167 | } | 168 | } |
168 | 169 | ||
@@ -1227,7 +1228,7 @@ int tomoyo_check_open_permission(struct tomoyo_domain_info *domain, | |||
1227 | TOMOYO_TYPE_TRUNCATE_ACL, | 1228 | TOMOYO_TYPE_TRUNCATE_ACL, |
1228 | buf, mode); | 1229 | buf, mode); |
1229 | out: | 1230 | out: |
1230 | tomoyo_free(buf); | 1231 | kfree(buf); |
1231 | tomoyo_read_unlock(idx); | 1232 | tomoyo_read_unlock(idx); |
1232 | if (!is_enforce) | 1233 | if (!is_enforce) |
1233 | error = 0; | 1234 | error = 0; |
@@ -1273,7 +1274,7 @@ int tomoyo_check_1path_perm(struct tomoyo_domain_info *domain, | |||
1273 | error = tomoyo_check_single_path_permission2(domain, operation, buf, | 1274 | error = tomoyo_check_single_path_permission2(domain, operation, buf, |
1274 | mode); | 1275 | mode); |
1275 | out: | 1276 | out: |
1276 | tomoyo_free(buf); | 1277 | kfree(buf); |
1277 | tomoyo_read_unlock(idx); | 1278 | tomoyo_read_unlock(idx); |
1278 | if (!is_enforce) | 1279 | if (!is_enforce) |
1279 | error = 0; | 1280 | error = 0; |
@@ -1312,7 +1313,7 @@ int tomoyo_check_rewrite_permission(struct tomoyo_domain_info *domain, | |||
1312 | TOMOYO_TYPE_REWRITE_ACL, | 1313 | TOMOYO_TYPE_REWRITE_ACL, |
1313 | buf, mode); | 1314 | buf, mode); |
1314 | out: | 1315 | out: |
1315 | tomoyo_free(buf); | 1316 | kfree(buf); |
1316 | tomoyo_read_unlock(idx); | 1317 | tomoyo_read_unlock(idx); |
1317 | if (!is_enforce) | 1318 | if (!is_enforce) |
1318 | error = 0; | 1319 | error = 0; |
@@ -1379,8 +1380,8 @@ int tomoyo_check_2path_perm(struct tomoyo_domain_info * const domain, | |||
1379 | false); | 1380 | false); |
1380 | } | 1381 | } |
1381 | out: | 1382 | out: |
1382 | tomoyo_free(buf1); | 1383 | kfree(buf1); |
1383 | tomoyo_free(buf2); | 1384 | kfree(buf2); |
1384 | tomoyo_read_unlock(idx); | 1385 | tomoyo_read_unlock(idx); |
1385 | if (!is_enforce) | 1386 | if (!is_enforce) |
1386 | error = 0; | 1387 | error = 0; |