Page MenuHomeFreeBSD

Close races in vm object chain traversal for unlock
ClosedPublic

Authored by rlibby on Feb 25 2021, 6:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Feb 28, 11:42 AM
Unknown Object (File)
Mon, Feb 24, 10:41 PM
Unknown Object (File)
Fri, Feb 21, 11:55 PM
Unknown Object (File)
Jan 26 2025, 1:37 AM
Unknown Object (File)
Jan 20 2025, 3:27 AM
Unknown Object (File)
Jan 11 2025, 11:29 PM
Unknown Object (File)
Dec 8 2024, 9:42 PM
Unknown Object (File)
Dec 6 2024, 12:41 PM
Subscribers

Details

Summary

We were unlocking the vm object before reading the backing_object field.
In the meantime, the object could be freed and reused. This could cause
us to go off the rails in the object chain traversal, failing to unlock
the rest of the objects in the original chain and corrupting the lock
state of the victim chain.

MFC after: 3 days
Sponsored by: Dell EMC Isilon

Test Plan
procstat -av
mount -t procfs proc /proc
cat /proc/*/map

Diff Detail

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

Event Timeline

This revision is now accepted and ready to land.Feb 25 2021, 6:37 PM

This can be done without introducing another object pointer (nobj) by resetting lobj and following the pattern elsewhere, but I found the approach with nobj to be more readable.

I looked for other occurrences of this but didn't find any.