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:
c4004b0
)
lkdtm: fix memory leak of val
author
Sudip Mukherjee
<sudipm.mukherjee@gmail.com>
Tue, 5 Apr 2016 17:11:05 +0000
(22:41 +0530)
committer
Kees Cook
<keescook@chromium.org>
Wed, 6 Apr 2016 23:22:23 +0000
(16:22 -0700)
This case is supposed to read from a page after after it is freed, but
it missed freeing val if we are not able to get a free page.
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
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 5f1a36b8fbb082af1d0251504e19a33e1dc8c621..2f0b0224876111104ef62936403efd6f59e40052 100644
(file)
--- a/
drivers/misc/lkdtm.c
+++ b/
drivers/misc/lkdtm.c
@@
-498,12
+498,13
@@
static void lkdtm_do_action(enum ctype which)
}
case CT_READ_BUDDY_AFTER_FREE: {
unsigned long p = __get_free_page(GFP_KERNEL);
- int saw, *val
= kmalloc(1024, GFP_KERNEL)
;
+ int saw, *val;
int *base;
if (!p)
break;
+ val = kmalloc(1024, GFP_KERNEL);
if (!val)
break;