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>
This commit is contained in:
Sudip Mukherjee 2016-04-05 22:41:05 +05:30 коммит произвёл Kees Cook
Родитель c4004b02f8
Коммит 50fbd97773
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -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;