Jan Kara a056bdaae7 ext4: fix data corruption for mmap writes
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>
2017-05-26 17:45:45 -04:00
..
2015-04-02 23:47:42 -04:00
2016-09-30 02:14:56 -04:00
2017-04-30 00:36:53 -04:00
2017-04-30 00:36:53 -04:00
2017-02-02 11:52:14 -05:00
2016-05-13 00:44:16 -04:00
2017-04-30 00:36:53 -04:00
2017-04-30 00:36:53 -04:00
2016-03-09 23:49:05 -05:00
2016-11-01 09:43:26 -06:00
2017-04-03 01:05:58 -04:00