aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/security/integrity/ima/ima_api.c
diff options
context:
space:
mode:
authorDmitry Kasatkin <dmitry.kasatkin@gmail.com>2014-10-01 21:43:10 +0300
committerMimi Zohar <zohar@linux.vnet.ibm.com>2014-10-07 14:32:54 -0400
commit456f5fd3f6017f10d04d459159ac7bd9e3815c5e (patch)
tree304de71a234e3c302f7b372f72affd5661f30221 /security/integrity/ima/ima_api.c
parentevm: skip replacing EVM signature with HMAC on read-only filesystem (diff)
downloadwireguard-linux-456f5fd3f6017f10d04d459159ac7bd9e3815c5e.tar.xz
wireguard-linux-456f5fd3f6017f10d04d459159ac7bd9e3815c5e.zip
ima: use path names cache
__getname() uses slab allocation which is faster than kmalloc. Make use of it. Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com> Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Diffstat (limited to 'security/integrity/ima/ima_api.c')
-rw-r--r--security/integrity/ima/ima_api.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/security/integrity/ima/ima_api.c b/security/integrity/ima/ima_api.c
index 86885979918c..a99eb6d4bc09 100644
--- a/security/integrity/ima/ima_api.c
+++ b/security/integrity/ima/ima_api.c
@@ -325,11 +325,11 @@ const char *ima_d_path(struct path *path, char **pathbuf)
{
char *pathname = NULL;
- *pathbuf = kmalloc(PATH_MAX, GFP_KERNEL);
+ *pathbuf = __getname();
if (*pathbuf) {
pathname = d_absolute_path(path, *pathbuf, PATH_MAX);
if (IS_ERR(pathname)) {
- kfree(*pathbuf);
+ __putname(*pathbuf);
*pathbuf = NULL;
pathname = NULL;
}