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)
Feb 18 2024, 2:02 PM
Unknown Object (File)
Feb 10 2024, 4:42 AM
Unknown Object (File)
Jan 22 2024, 10:07 PM
Unknown Object (File)
Jan 10 2024, 1:54 AM
Unknown Object (File)
Dec 27 2023, 10:05 AM
Unknown Object (File)
Dec 12 2023, 1:33 PM
Unknown Object (File)
Oct 23 2023, 1:42 PM
Unknown Object (File)
Sep 4 2023, 12:31 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.