summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-10-04 04:03:58 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2022-10-04 04:03:58 +0300
commitda380aefdd185f6dfe3e5555d554dc6a006d2682 (patch)
tree573235fbb1b7815b34aa6e3c1a69beae5be5e242
parent26b84401da8458c5cbd6818d5732f7bbb84124a2 (diff)
parent4f526fef91b24197d489ff86789744c67f475bb4 (diff)
downloadlinux-da380aefdd185f6dfe3e5555d554dc6a006d2682.tar.xz
Merge tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull coredump fix from Al Viro: "Brown paper bag bug fix for the coredumping fix late in the 6.0 release cycle" * tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: [brown paperbag] fix coredump breakage
-rw-r--r--fs/coredump.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/coredump.c b/fs/coredump.c
index 1ab4f5b76a1e..3538f3a63965 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -841,7 +841,7 @@ static int dump_emit_page(struct coredump_params *cprm, struct page *page)
};
struct iov_iter iter;
struct file *file = cprm->file;
- loff_t pos = file->f_pos;
+ loff_t pos;
ssize_t n;
if (cprm->to_skip) {
@@ -853,6 +853,7 @@ static int dump_emit_page(struct coredump_params *cprm, struct page *page)
return 0;
if (dump_interrupted())
return 0;
+ pos = file->f_pos;
iov_iter_bvec(&iter, WRITE, &bvec, 1, PAGE_SIZE);
n = __kernel_write_iter(cprm->file, &iter, &pos);
if (n != PAGE_SIZE)