summaryrefslogtreecommitdiff
path: root/security/tomoyo/file.c
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2010-01-26 11:45:27 (GMT)
committerJames Morris <jmorris@namei.org>2010-01-26 21:20:48 (GMT)
commit8e2d39a1665e680c095545993aac2fcac6916eb9 (patch)
tree41687f7e7f4fb37416b7948b6d2e09d0a383459b /security/tomoyo/file.c
parent7d52a155e38d5a165759dbbee656455861bf7801 (diff)
downloadlinux-fsl-qoriq-8e2d39a1665e680c095545993aac2fcac6916eb9.tar.xz
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.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/security/tomoyo/file.c b/security/tomoyo/file.c
index cfcb096..24af081 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)
static struct tomoyo_path_info *tomoyo_get_path(struct path *path)
{
int error;
- struct tomoyo_path_info_with_data *buf = tomoyo_alloc(sizeof(*buf));
+ struct tomoyo_path_info_with_data *buf = kzalloc(sizeof(*buf),
+ GFP_KERNEL);
if (!buf)
return NULL;
@@ -162,7 +163,7 @@ static struct tomoyo_path_info *tomoyo_get_path(struct path *path)
tomoyo_fill_path_info(&buf->head);
return &buf->head;
}
- tomoyo_free(buf);
+ kfree(buf);
return NULL;
}
@@ -1227,7 +1228,7 @@ int tomoyo_check_open_permission(struct tomoyo_domain_info *domain,
TOMOYO_TYPE_TRUNCATE_ACL,
buf, mode);
out:
- tomoyo_free(buf);
+ kfree(buf);
tomoyo_read_unlock(idx);
if (!is_enforce)
error = 0;
@@ -1273,7 +1274,7 @@ int tomoyo_check_1path_perm(struct tomoyo_domain_info *domain,
error = tomoyo_check_single_path_permission2(domain, operation, buf,
mode);
out:
- tomoyo_free(buf);
+ kfree(buf);
tomoyo_read_unlock(idx);
if (!is_enforce)
error = 0;
@@ -1312,7 +1313,7 @@ int tomoyo_check_rewrite_permission(struct tomoyo_domain_info *domain,
TOMOYO_TYPE_REWRITE_ACL,
buf, mode);
out:
- tomoyo_free(buf);
+ kfree(buf);
tomoyo_read_unlock(idx);
if (!is_enforce)
error = 0;
@@ -1379,8 +1380,8 @@ int tomoyo_check_2path_perm(struct tomoyo_domain_info * const domain,
false);
}
out:
- tomoyo_free(buf1);
- tomoyo_free(buf2);
+ kfree(buf1);
+ kfree(buf2);
tomoyo_read_unlock(idx);
if (!is_enforce)
error = 0;