busdma: Protect ARM busdma bounce page counters using the bounce page lock.
authorHans Petter Selasky <hselasky@FreeBSD.org>
Thu, 23 Jun 2022 09:31:17 +0000 (11:31 +0200)
committerHans Petter Selasky <hselasky@FreeBSD.org>
Sat, 25 Jun 2022 10:01:59 +0000 (12:01 +0200)
commit6c4b6f55f77d8d7cee1b277bd6579a77d6890ef9
tree7714d2104f51d2a8277934625ee210ba4ad66e9d
parent61c74fb66f1bef776923cbd5b2a62fb06b003f0c
busdma: Protect ARM busdma bounce page counters using the bounce page lock.

In bus_dmamap_unload() on ARM, 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.

This was noticed on a 2GB quad core i.MX6 system that has more than one device
attached via FTDI based USB serial connection.

Submitted by: John Hein <jcfyecrayz@liamekaens.com>
Differential Revision: https://reviews.freebsd.org/D35553
PR: 264836
MFC after: 3 days
Sponsored by: NVIDIA Networking
sys/arm/arm/busdma_machdep.c