Skip to contentSkip to conversation

Hole punch races in CIFS

DISCUSSION Jan Kara 1 participant 1 message Apr 22, 2021

Subsystems (3)
lore
Share & tools
lore

Jan Kara

author reviewer
#0 lore raw

Hello,

I was looking into what protects CIFS from races between hole punching and operations like page fault or readahead and AFAICT there's nothing to prevent a race like:

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 and if the page gets later dirtied and written out, even persistent data corruption. Is there anything I'm missing?

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR