]> www.infradead.org Git - users/jedix/linux-maple.git/commit
coredump: fix memleak in dump_vma_snapshot()
authorQiuXi <qiuxi1@huawei.com>
Tue, 24 Aug 2021 00:00:03 +0000 (10:00 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Aug 2021 23:34:57 +0000 (09:34 +1000)
commit6b33bde8d1f8079f6c5b429caa2f1cfc39764526
treefb3d78db4434b4d38fd2c7066e20751545e587d4
parente7b81ca105f96a1bf1323cc2fbd42849c158a1aa
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>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
fs/coredump.c