Page MenuHomeFreeBSD

protect arm busdma bounce page counters with bounce page lock

Authored by hselasky on Jun 22 2022, 11:23 PM.
Referenced Files
Unknown Object (File)
Wed, Feb 7, 8:40 PM
Unknown Object (File)
Sun, Feb 4, 6:25 PM
Unknown Object (File)
Dec 30 2023, 6:09 AM
Unknown Object (File)
Dec 20 2023, 8:33 AM
Unknown Object (File)
Dec 14 2023, 12:35 PM
Unknown Object (File)
Dec 12 2023, 3:57 AM
Unknown Object (File)
Oct 13 2023, 4:14 PM
Unknown Object (File)
Oct 1 2023, 1:13 PM



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

Please suggest appropriate reviewers.

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

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.