+ mm-vmallocc-dont-dereference-possible-null-pointer-in-__vunmap.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm/vmalloc.c: don't dereference possible NULL pointer in __vunmap()
has been added to the -mm tree.  Its filename is
     mm-vmallocc-dont-dereference-possible-null-pointer-in-__vunmap.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-vmallocc-dont-dereference-possible-null-pointer-in-__vunmap.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-vmallocc-dont-dereference-possible-null-pointer-in-__vunmap.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Liviu Dudau <liviu@xxxxxxxxxxx>
Subject: mm/vmalloc.c: don't dereference possible NULL pointer in __vunmap()

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@xxxxxxxxxxx
Fixes: f3c01d2f3ade ("mm: vmalloc: avoid racy handling of debugobjects
in vunmap")
Signed-off-by: Liviu Dudau <liviu@xxxxxxxxxxx>
Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Chintan Pandya <cpandya@xxxxxxxxxxxxxx>
Cc: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---


--- a/mm/vmalloc.c~mm-vmallocc-dont-dereference-possible-null-pointer-in-__vunmap
+++ a/mm/vmalloc.c
@@ -1505,7 +1505,7 @@ static void __vunmap(const void *addr, i
 			addr))
 		return;
 
-	area = find_vmap_area((unsigned long)addr)->vm;
+	area = find_vm_area(addr);
 	if (unlikely(!area)) {
 		WARN(1, KERN_ERR "Trying to vfree() nonexistent vm area (%p)\n",
 				addr);
_

Patches currently in -mm which might be from liviu@xxxxxxxxxxx are

mm-vmallocc-dont-dereference-possible-null-pointer-in-__vunmap.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux