Page MenuHomeFreeBSD

vm_fault: Fix a racy copy of page valid bits
ClosedPublic

Authored by markj on Jun 13 2022, 3:49 PM.
Tags
None
Referenced Files
F116042978: D35471.diff
Fri, May 2, 12:03 AM
F116008862: D35471.id106865.diff
Thu, May 1, 1:06 PM
Unknown Object (File)
Mar 21 2025, 1:45 PM
Unknown Object (File)
Mar 18 2025, 5:45 AM
Unknown Object (File)
Jan 27 2025, 9:47 AM
Unknown Object (File)
Jan 26 2025, 7:17 PM
Unknown Object (File)
Jan 26 2025, 4:12 PM
Unknown Object (File)
Jan 25 2025, 2:22 PM
Subscribers

Details

Summary

We do not hold the object lock or a page busy lock when copying src_m's
validity state. Prior to commit 45d72c7d7fca we marked dst_m as fully
valid.

Use the source object's read lock to ensure that valid bits are not
concurrently cleared.

Noticed during code inspection.

Fixes: 45d72c7d7fca ("vm_fault_copy_entry: accept invalid source pages.")

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 45956
Build 42844: arc lint + arc unit

Event Timeline

markj requested review of this revision.Jun 13 2022, 3:49 PM
This revision is now accepted and ready to land.Jun 13 2022, 7:15 PM
sys/vm/vm_fault.c
2149–2152

I would also suggest moving the WUNLOCK/WLOCK inside this "if" statement,

markj added inline comments.
sys/vm/vm_fault.c
2149–2152

Done in D35485

This revision was automatically updated to reflect the committed changes.
markj marked an inline comment as done.