]> git.baikalelectronics.ru Git - kernel.git/commit
coredump: fix dumping through pipes
authorMateusz Guzik <mguzik@redhat.com>
Sun, 5 Jun 2016 21:14:14 +0000 (23:14 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 8 Jun 2016 02:07:09 +0000 (22:07 -0400)
commitb17a6658b1c2acafd0c47ae7c9cb520419aad148
tree664e5239468f2bc978c6b8c6f2fb64904c20f7e9
parent06fe94a650edeb9e8ab034e7c0d048bbca4d3490
coredump: fix dumping through pipes

The offset in the core file used to be tracked with ->written field of
the coredump_params structure. The field was retired in favour of
file->f_pos.

However, ->f_pos is not maintained for pipes which leads to breakage.

Restore explicit tracking of the offset in coredump_params. Introduce
->pos field for this purpose since ->written was already reused.

Fixes: c287cadb2014 ("get rid of coredump_params->written").
Reported-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Mateusz Guzik <mguzik@redhat.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/powerpc/platforms/cell/spufs/coredump.c
fs/binfmt_elf.c
fs/binfmt_elf_fdpic.c
fs/coredump.c
include/linux/binfmts.h