Skip to contentSkip to conversation

mm-cma-fix-null-pointer-dereference-when-cma-could-not-be-activated.patch removed from -mm tree

merged [email protected] 1 participant 1 message Aug 12, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

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 <[email protected]>
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.

---

 mm/cma.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/cma.c renamed from mm/cma.c~mm-cma-fix-null-pointer-dereference-when-cma-could-not-be-activated +1 -1
@@ -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 [email protected] are