Page MenuHomeFreeBSD

Fix a race in vm_page_pagequeue_lockptr().
ClosedPublic

Authored by markj on May 17 2018, 4:11 AM.
Tags
None
Referenced Files
F85617334: D15462.diff
Sat, Jun 8, 9:33 AM
Unknown Object (File)
Tue, May 14, 1:56 AM
Unknown Object (File)
Mon, May 13, 4:23 PM
Unknown Object (File)
Mon, May 13, 4:22 PM
Unknown Object (File)
Mon, May 13, 4:01 PM
Unknown Object (File)
Apr 26 2024, 11:54 AM
Unknown Object (File)
Jan 24 2024, 9:30 PM
Unknown Object (File)
Dec 23 2023, 6:35 AM
Subscribers

Details

Summary

We check for m->queue == PQ_NONE but later use m->queue as an index. In
between the two references, the value of m->queue may change to PQ_NONE.
(The locking protocol ensures that m->queue cannot transition between
two queue indices: either the from-value or the to-value must be
PQ_NONE.) Read the value of m->queue once to avoid this problem.

Test Plan

Gleb reported seeing panics as a result of the use of a bogus
index into the pagequeue array, and also reported that this patch
fixed the panics.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 16640
Build 16545: arc lint + arc unit

Event Timeline

markj added reviewers: kib, alc, jeff.
markj added a subscriber: glebius.
This revision is now accepted and ready to land.May 17 2018, 4:15 AM
This revision was automatically updated to reflect the committed changes.