diff options
author | Jan Kara <jack@suse.cz> | 2021-04-22 16:52:32 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2021-07-13 14:29:01 +0200 |
commit | b092b3efc7cb239b6f33bb97da0f8812680e1046 (patch) | |
tree | d61a3007db3005aae514814d3d67721432418fda /drivers/net/wireless/zd1211rw/zd_rf_rf2959.c | |
parent | 057ba5b24532aca202cb1ae8c246bde27de12763 (diff) |
cifs: Fix race between hole punch and page fault
Cifs has a following race between hole punching and page fault:
CPU1 CPU2
smb3_fallocate()
smb3_punch_hole()
truncate_pagecache_range()
filemap_fault()
- loads old data into the
page cache
SMB2_ioctl(..., FSCTL_SET_ZERO_DATA, ...)
And now we have stale data in the page cache. Fix the problem by locking
out faults (as well as reads) using mapping->invalidate_lock while hole
punch is running.
CC: Steve French <sfrench@samba.org>
CC: linux-cifs@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'drivers/net/wireless/zd1211rw/zd_rf_rf2959.c')
0 files changed, 0 insertions, 0 deletions