mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
lkdtm: fix memory leak of val
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 <[email protected]> Signed-off-by: Kees Cook <[email protected]>
This commit is contained in:
parent
c4004b02f8
commit
50fbd97773
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue