diff options
author | Mel Gorman <[email protected]> | 2011-12-08 14:34:30 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2011-12-09 07:50:29 -0800 |
commit | 1368edf0647ac112d8cfa6ce47257dc950c50f5c (patch) | |
tree | 57b8c97689b2db9f22487c1b03a753d350ed657c /net/lapb/lapb_subr.c | |
parent | d021563888312018ca65681096f62e36c20e63cc (diff) |
mm: vmalloc: check for page allocation failure before vmlist insertion
Commit f5252e00 ("mm: avoid null pointer access in vm_struct via
/proc/vmallocinfo") adds newly allocated vm_structs to the vmlist after
it is fully initialised. Unfortunately, it did not check that
__vmalloc_area_node() successfully populated the area. In the event of
allocation failure, the vmalloc area is freed but the pointer to freed
memory is inserted into the vmlist leading to a a crash later in
get_vmalloc_info().
This patch adds a check for ____vmalloc_area_node() failure within
__vmalloc_node_range. It does not use "goto fail" as in the previous
error path as a warning was already displayed by __vmalloc_area_node()
before it called vfree in its failure path.
Credit goes to Luciano Chavez for doing all the real work of identifying
exactly where the problem was.
Signed-off-by: Mel Gorman <[email protected]>
Reported-by: Luciano Chavez <[email protected]>
Tested-by: Luciano Chavez <[email protected]>
Reviewed-by: Rik van Riel <[email protected]>
Acked-by: David Rientjes <[email protected]>
Cc: <[email protected]> [3.1.x+]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'net/lapb/lapb_subr.c')
0 files changed, 0 insertions, 0 deletions