alistair23-linux/fs/ext4
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: cb20d51883
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
..
acl.c ext4: fix quota charging for shared xattr blocks 2017-05-24 18:24:07 -04:00
acl.h
balloc.c
bitmap.c
block_validity.c ext4: add missing KERN_CONT to a few more debugging uses 2016-10-15 09:57:31 -04:00
dir.c
ext4.h ext4: remove unused d_name argument from ext4_search_dir() et al. 2017-05-24 18:10:49 -04:00
ext4_extents.h
ext4_jbd2.c ext4: add shutdown bit and check for it 2017-02-05 01:28:48 -05:00
ext4_jbd2.h ext4: do not perform data journaling when data is encrypted 2016-12-10 17:54:58 -05:00
extents.c ext4: fix data corruption with EXT4_GET_BLOCKS_ZERO 2017-05-26 17:40:52 -04:00
extents_status.c scripts/spelling.txt: add "comsume(r)" pattern and fix typo instances 2017-02-27 18:43:47 -08:00
extents_status.h
file.c ext4: fix off-by-one on max nr_pages in ext4_find_unwritten_pgoff() 2017-05-24 18:02:20 -04:00
fsmap.c ext4: support GETFSMAP ioctls 2017-04-30 00:36:53 -04:00
fsmap.h ext4: support GETFSMAP ioctls 2017-04-30 00:36:53 -04:00
fsync.c ext4: add shutdown bit and check for it 2017-02-05 01:28:48 -05:00
hash.c ext4: move halfmd4 into hash.c directly 2017-02-02 11:52:14 -05:00
ialloc.c ext4: inherit encryption xattr before other xattrs 2017-05-02 00:49:54 -04:00
indirect.c
inline.c ext4: remove unused d_name argument from ext4_search_dir() et al. 2017-05-24 18:10:49 -04:00
inode.c ext4: fix data corruption for mmap writes 2017-05-26 17:45:45 -04:00
ioctl.c Add GETFSMAP support; some performance improvements for very large 2017-05-08 11:30:05 -07:00
Kconfig dax: fix build warnings with FS_DAX and !FS_IOMAP 2017-01-24 16:26:14 -08:00
Makefile ext4: support GETFSMAP ioctls 2017-04-30 00:36:53 -04:00
mballoc.c ext4: handle the rest of ext4_mb_load_buddy() ENOMEM errors 2017-05-21 22:35:23 -04:00
mballoc.h ext4: support GETFSMAP ioctls 2017-04-30 00:36:53 -04:00
migrate.c
mmp.c block,fs: use REQ_* flags directly 2016-11-01 09:43:26 -06:00
move_extent.c Fix a memory leak on an error path, and two races when modifying 2017-03-26 10:29:21 -07:00
namei.c ext4: remove unused d_name argument from ext4_search_dir() et al. 2017-05-24 18:10:49 -04:00
page-io.c ext4: replace BUG_ON with WARN_ONCE in ext4_end_bio() 2017-04-30 20:08:05 -04:00
readpage.c
resize.c ext4: rename s_resize_flags to s_ext4_flags 2017-02-05 01:27:48 -05:00
super.c ext4: fix quota charging for shared xattr blocks 2017-05-24 18:24:07 -04:00
symlink.c ext4: Add statx support 2017-04-03 01:05:58 -04:00
sysfs.c ext4: constify static data that is never modified 2017-04-29 23:47:50 -04:00
truncate.h
xattr.c ext4: fix quota charging for shared xattr blocks 2017-05-24 18:24:07 -04:00
xattr.h ext4: fix deadlock between inline_data and ext4_expand_extra_isize_ea() 2017-01-11 21:50:46 -05:00
xattr_security.c
xattr_trusted.c
xattr_user.c