diff --git a/mm/vmalloc.c b/mm/vmalloc.c index cdff7385b216..a93077795ed2 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -490,7 +490,11 @@ static struct vmap_area *alloc_vmap_area(unsigned long size, } found: - if (addr + size > vend) + /* + * Check also calculated address against the vstart, + * because it can be 0 because of big align request. + */ + if (addr + size > vend || addr < vstart) goto overflow; va->va_start = addr;