summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2022-03-08 13:01:19 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-08 14:06:58 +0200
commitfea73e1a48018fac124629f953d60d0b4d90d1eb (patch)
tree89ca0d84965b9c894e73d3a646bfb5ba9b27ae2e
parent45bdff9c94adfeaf4c7d416286ea1313b2bfb3e8 (diff)
coredump: Remove the WARN_ON in dump_vma_snapshot
commit 49c1866348f364478a0c4d3dd13fd08bb82d3a5b upstream. The condition is impossible and to the best of my knowledge has never triggered. We are in deep trouble if that conditions happens and we walk past the end of our allocated array. So delete the WARN_ON and the code that makes it look like the kernel can handle the case of walking past the end of it's vma_meta array. Reviewed-by: Jann Horn <jannh@google.com> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/coredump.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/fs/coredump.c b/fs/coredump.c
index 99e50a3efe2f..707f6aa43a11 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -1085,12 +1085,6 @@ 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;