aboutsummaryrefslogtreecommitdiff
path: root/kernel/capability.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-05-25 11:46:22 -0400
committerMister Oyster <oysterized@gmail.com>2017-12-31 02:51:24 +0100
commite5983e9c4e1c61b347aeda7243266bee387a40e1 (patch)
treebac38b73898ee8585cc06881421622dee6f1c6a7 /kernel/capability.c
parenta1bac3c7c00397f50a3479c26fe1bd760bea7fc9 (diff)
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> [@nathanchance: fixed conflicts] Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Joe Maples <joe@frap129.org>
Diffstat (limited to 'kernel/capability.c')
0 files changed, 0 insertions, 0 deletions