From b7dbb1ee1fbd445f82c508e4ea9d9af7b25d3c72 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 19 Apr 2022 18:41:40 +0200 Subject: [PATCH] Revert "coredump: Remove the WARN_ON in dump_vma_snapshot" This reverts commit b043ae637a83585b2a497c2eb7ee49446fc68e98. It breaks the abi and is not needed for Android devices so it can be dropped. Bug: 161946584 Signed-off-by: Greg Kroah-Hartman Change-Id: I565f6e1c6053b1d43aa7fb69e0f6b533401d16be --- fs/coredump.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/coredump.c b/fs/coredump.c index d3799bc317b9..a605bd610867 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -1128,6 +1128,12 @@ static bool dump_vma_snapshot(struct coredump_params *cprm) mmap_write_unlock(mm); + if (WARN_ON(i != cprm->vma_count)) { + kvfree(cprm->vma_meta); + return false; + } + + for (i = 0; i < cprm->vma_count; i++) { struct core_vma_metadata *m = cprm->vma_meta + i;