mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [to-be-updated] mm-cma-support-sysfs-fix.patch removed from -mm tree
@ 2021-03-28 21:05 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2021-03-28 21:05 UTC (permalink / raw)
  To: colin.king, jhubbard, minchan, mm-commits


The patch titled
     Subject: mm: cma: fix potential null dereference on pointer cma
has been removed from the -mm tree.  Its filename was
     mm-cma-support-sysfs-fix.patch

This patch was dropped because an updated version will be merged

------------------------------------------------------
From: Colin Ian King <colin.king@canonical.com>
Subject: mm: cma: fix potential null dereference on pointer cma

At the start of the function there is a null pointer check on cma and then
branch to error handling label 'out'.  The subsequent call to
cma_sysfs_fail_pages_count dereferences cma, hence there is a potential
null pointer deference issue.  Fix this by only calling
cma_sysfs_fail_pages_count if cma is not null.

Addresses-Coverity: ("Dereference after null check")

Link: https://lkml.kernel.org/r/20210316100433.17665-1-colin.king@canonical.com
Fixes: dc4764f7e9ac ("mm: cma: support sysfs")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

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

--- a/mm/cma.c~mm-cma-support-sysfs-fix
+++ a/mm/cma.c
@@ -512,7 +512,8 @@ out:
 		cma_sysfs_alloc_pages_count(cma, count);
 	} else {
 		count_vm_event(CMA_ALLOC_FAIL);
-		cma_sysfs_fail_pages_count(cma, count);
+		if (cma)
+			cma_sysfs_fail_pages_count(cma, count);
 	}
 
 	return page;
_

Patches currently in -mm which might be from colin.king@canonical.com are

mm-vmalloc-hugepage-vmalloc-mappings-fix.patch
proc-fix-incorrect-pde_is_permanent-check.patch
mm-slab-fix-spelling-mistake-disired-desired.patch


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

only message in thread, other threads:[~2021-03-28 21:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-28 21:05 [to-be-updated] mm-cma-support-sysfs-fix.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).