Page MenuHomeFreeBSD

protect arm busdma bounce page counters with bounce page lock
ClosedPublic

Authored by hselasky on Jun 22 2022, 11:23 PM.
Tags
Referenced Files
Unknown Object (File)
Sat, Feb 28, 1:54 AM
Unknown Object (File)
Feb 1 2026, 1:22 PM
Unknown Object (File)
Jan 15 2026, 5:52 AM
Unknown Object (File)
Jan 13 2026, 11:00 AM
Unknown Object (File)
Dec 22 2025, 9:35 PM
Unknown Object (File)
Dec 19 2025, 2:50 AM
Unknown Object (File)
Dec 18 2025, 4:09 PM
Unknown Object (File)
Dec 17 2025, 12:12 AM

Details

Summary

In bus_dmamap_unload(), the counters for free_bpages and reserved_bpages appear to be vulnerable to unprotected read-modify-write operations that result in accounting that looks like a page leak.

See also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264836

Please suggest appropriate reviewers.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This revision is now accepted and ready to land.Jun 23 2022, 8:34 AM

I've suggested some optimizations. Have a look at the PR.

This revision now requires review to proceed.Jun 23 2022, 7:20 PM

Updated patch a bit. Maybe this piece of code can be removed altogether ...

This revision is now accepted and ready to land.Jun 23 2022, 7:21 PM

Andrew: Do you have time to have a quick look here?

It looks correct, however I don't know much about the 32-bit arm busdma code.