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)
Sun, Dec 8, 9:42 PM
Unknown Object (File)
Fri, Dec 6, 12:41 PM
Unknown Object (File)
Nov 1 2024, 10:47 AM
Unknown Object (File)
Oct 19 2024, 9:11 PM
Unknown Object (File)
Oct 19 2024, 9:10 PM
Unknown Object (File)
Oct 19 2024, 9:10 PM
Unknown Object (File)
Oct 19 2024, 8:48 PM
Unknown Object (File)
Oct 5 2024, 6:39 AM
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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.