]> www.infradead.org Git - users/jedix/linux-maple.git/commit
coredump: Ensure proper size of sparse core files
authorDave Kleikamp <dave.kleikamp@oracle.com>
Wed, 11 Jan 2017 19:25:00 +0000 (13:25 -0600)
committerChuck Anderson <chuck.anderson@oracle.com>
Sat, 25 Feb 2017 04:12:47 +0000 (20:12 -0800)
commitc862ec637d37851a6a39cec0d82de7bfd11a503c
tree464bdbf24725a97ac544a18b8251ed7ec86443d5
parentf4bc4177c4d40d79b25b817035f8b1bf30d76533
coredump: Ensure proper size of sparse core files

If the last section of a core file ends with an unmapped or zero page,
the size of the file does not correspond with the last dump_skip() call.
gdb complains that the file is truncated and can be confusing to users.

After all of the vma sections are written, make sure that the file size
is no smaller than the current file position.

This problem can be demonstrated with gdb's bigcore testcase on the
sparc architecture.

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Orabug: 22106344
Mainline v4.10 commit 4d22c75d4c7b5c5f4bd31054f09103ee490878fd
fs/binfmt_elf.c
fs/coredump.c
include/linux/coredump.h