Searched hist:bcb615a81b1765864c71c50afb56631e7a1e5283 (Results 1 – 1 of 1) sorted by relevance
/openbmc/linux/mm/ |
H A D | vmalloc.c | diff bcb615a81b1765864c71c50afb56631e7a1e5283 Mon Jul 08 18:00:19 CDT 2013 Zhang Yanfei <zhangyanfei.yes@gmail.com> mm/vmalloc.c: fix an overflow bug in alloc_vmap_area()
When searching a vmap area in the vmalloc space, we use (addr + size - 1) to check if the value is less than addr, which is an overflow. But we assign (addr + size) to vmap_area->va_end.
So if we come across the below case:
(addr + size - 1) : not overflow (addr + size) : overflow
we will assign an overflow value (e.g 0) to vmap_area->va_end, And this will trigger BUG in __insert_vmap_area, causing system panic.
So using (addr + size) to check the overflow should be the correct behaviour, not (addr + size - 1).
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Reported-by: Ghennadi Procopciuc <unix140@gmail.com> Tested-by: Daniel Baluta <dbaluta@ixiacom.com> Cc: David Rientjes <rientjes@google.com> Cc: Minchan Kim <minchan@kernel.org> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|