mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [merged] mm-cma-fix-null-pointer-dereference-when-cma-could-not-be-activated.patch removed from -mm tree
@ 2020-08-12 21:02 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2020-08-12 21:02 UTC (permalink / raw)
  To: david, jay.xu, mm-commits


The patch titled
     Subject: mm/cma.c: fix NULL pointer dereference when cma could not be activated
has been removed from the -mm tree.  Its filename was
     mm-cma-fix-null-pointer-dereference-when-cma-could-not-be-activated.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Jianqun Xu <jay.xu@rock-chips.com>
Subject: mm/cma.c: fix NULL pointer dereference when cma could not be activated

In some case the cma area could not be activated, but the cma_alloc be
used under this case, then the kernel will crash caused by NULL pointer
dereference.

Add bitmap valid check in cma_alloc to avoid this issue.

Link: http://lkml.kernel.org/r/20200615010123.15596-1-jay.xu@rock-chips.com
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/cma.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/cma.c~mm-cma-fix-null-pointer-dereference-when-cma-could-not-be-activated
+++ a/mm/cma.c
@@ -425,7 +425,7 @@ struct page *cma_alloc(struct cma *cma,
 	struct page *page = NULL;
 	int ret = -ENOMEM;
 
-	if (!cma || !cma->count)
+	if (!cma || !cma->count || !cma->bitmap)
 		return NULL;
 
 	pr_debug("%s(cma %p, count %zu, align %d)\n", __func__, (void *)cma,
_

Patches currently in -mm which might be from jay.xu@rock-chips.com are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-12 21:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-12 21:02 [merged] mm-cma-fix-null-pointer-dereference-when-cma-could-not-be-activated.patch removed from -mm tree akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).