]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mm/vmalloc.c: don't dereference possible NULL pointer in __vunmap()
authorLiviu Dudau <liviu@dudau.co.uk>
Tue, 5 Mar 2019 23:42:54 +0000 (15:42 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jun 2020 06:18:11 +0000 (08:18 +0200)
commitbe22b6df6d80494ad855ed04fb990267d2db2f15
tree4a524a0d07ddc938dcf6d182291f0c71c6488809
parent97af903f0f3882ceb202080c2369f015d843b895
mm/vmalloc.c: don't dereference possible NULL pointer in __vunmap()

commit 6ade20327dbb808882888ed8ccded71e93067cf9 upstream.

find_vmap_area() can return a NULL pointer and we're going to
dereference it without checking it first.  Use the existing
find_vm_area() function which does exactly what we want and checks for
the NULL pointer.

Link: http://lkml.kernel.org/r/20181228171009.22269-1-liviu@dudau.co.uk
Fixes: f3c01d2f3ade ("mm: vmalloc: avoid racy handling of debugobjects in vunmap")
Signed-off-by: Liviu Dudau <liviu@dudau.co.uk>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Chintan Pandya <cpandya@codeaurora.org>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/vmalloc.c