diff options
| author | gregkh@linuxfoundation.org <gregkh@linuxfoundation.org> | 2017-10-10 21:50:51 +0200 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-12-10 14:34:39 +0100 |
| commit | 156b66c5bad7fa7621024c2537bfeb48e5a21da0 (patch) | |
| tree | 2f6b8ec0fdfd1e1b3c34fdb6204563d29ab530f3 /include/linux/ion_debugger_kernel.h | |
| parent | d3dc597a6c754da47500866c8ebaa46bda2b5e1d (diff) | |
ext4: fix data corruption for mmap writes
3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <jack@suse.cz>
commit a056bdaae7a181f7dcc876cfab2f94538e508709 upstream.
mpage_submit_page() can race with another process growing i_size and
writing data via mmap to the written-back page. As mpage_submit_page()
samples i_size too early, it may happen that ext4_bio_write_page()
zeroes out too large tail of the page and thus corrupts user data.
Fix the problem by sampling i_size only after the page has been
write-protected in page tables by clear_page_dirty_for_io() call.
Reported-by: Michael Zimmer <michael@swarm64.com>
CC: stable@vger.kernel.org
Fixes: cb20d5188366f04d96d2e07b1240cc92170ade40
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/ion_debugger_kernel.h')
0 files changed, 0 insertions, 0 deletions
