aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2011-12-08 14:34:30 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2011-12-21 12:57:36 -0800
commit3a15d7377faf8b10d04febc6c265ecf5f52c2558 (patch)
treeeb8b8f5227812ebacfb2bf216e3c384c6cddcc22 /security
parent21830d75b1b3752a6418157c0abae8a11938d356 (diff)
downloadkernel_samsung_smdk4412-3a15d7377faf8b10d04febc6c265ecf5f52c2558.zip
kernel_samsung_smdk4412-3a15d7377faf8b10d04febc6c265ecf5f52c2558.tar.gz
kernel_samsung_smdk4412-3a15d7377faf8b10d04febc6c265ecf5f52c2558.tar.bz2
mm: vmalloc: check for page allocation failure before vmlist insertion
commit 1368edf0647ac112d8cfa6ce47257dc950c50f5c upstream. 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 <mgorman@suse.de> Reported-by: Luciano Chavez <lnx1138@linux.vnet.ibm.com> Tested-by: Luciano Chavez <lnx1138@linux.vnet.ibm.com> Reviewed-by: Rik van Riel <riel@redhat.com> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'security')
0 files changed, 0 insertions, 0 deletions