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
Unknown Object (File)
Fri, Sep 27, 3:52 AM
Unknown Object (File)
Wed, Sep 25, 1:34 PM
Unknown Object (File)
Wed, Sep 25, 3:50 AM
Unknown Object (File)
Sun, Sep 22, 6:49 AM
Unknown Object (File)
Thu, Sep 19, 9:18 PM
Unknown Object (File)
Tue, Sep 17, 9:27 AM
Unknown Object (File)
Sep 2 2024, 7:43 PM
Unknown Object (File)
Aug 6 2024, 8:41 AM
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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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
2139–2142

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

markj added inline comments.
sys/vm/vm_fault.c
2139–2142

Done in D35485

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