summaryrefslogtreecommitdiff
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-05-26 17:45:45 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-12 11:27:35 +0200
commit40c00e5fac3abbd5e6fa08e93fa99b3e632ece16 (patch)
tree82575b3f77809c7c87e42444d2fb95e6d6622a21 /kernel/sysctl.c
parent90fd6738731b6d105fc8f04832ae17a9ac82c05c (diff)
ext4: fix data corruption for mmap writes
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 'kernel/sysctl.c')
0 files changed, 0 insertions, 0 deletions