projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d2e1008
)
lkdtm: do not leak free page on kmalloc failure
author
Kees Cook
<keescook@chromium.org>
Wed, 6 Apr 2016 22:53:27 +0000
(15:53 -0700)
committer
Kees Cook
<keescook@chromium.org>
Wed, 6 Apr 2016 23:22:25 +0000
(16:22 -0700)
This frees the allocated page if there is a kmalloc failure.
Signed-off-by: Kees Cook <keescook@chromium.org>
drivers/misc/lkdtm.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/misc/lkdtm.c
b/drivers/misc/lkdtm.c
index 5b3a63c87ec9758820a8d255ea8173a6ef4554fb..0a5cbbe12452da62127af8ced48101bb9fc212b8 100644
(file)
--- a/
drivers/misc/lkdtm.c
+++ b/
drivers/misc/lkdtm.c
@@
-507,8
+507,10
@@
static void lkdtm_do_action(enum ctype which)
break;
val = kmalloc(1024, GFP_KERNEL);
- if (!val)
+ if (!val) {
+ free_page(p);
break;
+ }
base = (int *)p;