* [merged] coredump-fix-memleak-in-dump_vma_snapshot.patch removed from -mm tree
@ 2021-09-09 21:05 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2021-09-09 21:05 UTC (permalink / raw)
To: gregkh, jannh, mm-commits, qiuxi1, viro
The patch titled
Subject: coredump: fix memleak in dump_vma_snapshot()
has been removed from the -mm tree. Its filename was
coredump-fix-memleak-in-dump_vma_snapshot.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: QiuXi <qiuxi1@huawei.com>
Subject: coredump: fix memleak in dump_vma_snapshot()
dump_vma_snapshot() allocs memory for *vma_meta, when dump_vma_snapshot()
returns -EFAULT, the memory will be leaked, so we free it correctly.
Link: https://lkml.kernel.org/r/20210810020441.62806-1-qiuxi1@huawei.com
Fixes: a07279c9a8cd7 ("binfmt_elf, binfmt_elf_fdpic: use a VMA list snapshot")
Signed-off-by: QiuXi <qiuxi1@huawei.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Jann Horn <jannh@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
fs/coredump.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/fs/coredump.c~coredump-fix-memleak-in-dump_vma_snapshot
+++ a/fs/coredump.c
@@ -1134,8 +1134,10 @@ int dump_vma_snapshot(struct coredump_pa
mmap_write_unlock(mm);
- if (WARN_ON(i != *vma_count))
+ if (WARN_ON(i != *vma_count)) {
+ kvfree(*vma_meta);
return -EFAULT;
+ }
*vma_data_size_ptr = vma_data_size;
return 0;
_
Patches currently in -mm which might be from qiuxi1@huawei.com are
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-09-09 21:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09 21:05 [merged] coredump-fix-memleak-in-dump_vma_snapshot.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).