summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Rumberg <kristian5.rumberg@sonymobile.com>2015-11-12 12:55:51 +0100
committerKristian Rumberg <kristian5.rumberg@sonymobile.com>2015-11-12 14:00:17 +0100
commita1ac6fb6ec97ee80312a684112dab9168609fbe7 (patch)
tree0ee3e66530fe16170699b3463d0eae4bf4be44d4
parentf06d6f49309274cb4a5753ae1650b4b765c8eb20 (diff)
downloadbcm-a1ac6fb6ec97ee80312a684112dab9168609fbe7.tar.gz
seccomp: Avoid kzalloc 64kb alloc failure by switching to vzalloc
This fixes android.os.cts.SeccompTest#testKernelBasicTests Issue: KIONE-3225 Bug=25562902 Change-Id: I1f3f5c1314923ffc10b3472950cd2fffc11af0a0
-rw-r--r--kernel/seccomp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/seccomp.c b/kernel/seccomp.c
index dd843aa6794..725719796cc 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
@@ -31,6 +31,7 @@
#include <linux/security.h>
#include <linux/tracehook.h>
#include <linux/uaccess.h>
+#include <linux/vmalloc.h>
/**
* struct seccomp_filter - container for seccomp BPF programs
@@ -394,8 +395,7 @@ static struct seccomp_filter *seccomp_prepare_filter(struct sock_fprog *fprog)
return ERR_PTR(-EACCES);
/* Allocate a new seccomp_filter */
- filter = kzalloc(sizeof(struct seccomp_filter) + fp_size,
- GFP_KERNEL|__GFP_NOWARN);
+ filter = vzalloc(sizeof(struct seccomp_filter) + fp_size);
if (!filter)
return ERR_PTR(-ENOMEM);;
atomic_set(&filter->usage, 1);
@@ -419,7 +419,7 @@ static struct seccomp_filter *seccomp_prepare_filter(struct sock_fprog *fprog)
return filter;
fail:
- kfree(filter);
+ vfree(filter);
return ERR_PTR(ret);
}
@@ -511,7 +511,7 @@ void get_seccomp_filter(struct task_struct *tsk)
static inline void seccomp_filter_free(struct seccomp_filter *filter)
{
if (filter) {
- kfree(filter);
+ vfree(filter);
}
}