HomeFreeBSD

bhyve: avoid overflow of BAR index

Description

bhyve: avoid overflow of BAR index

At the moment, writes to BAR registers that aren't 4 byte aligned are
ignored. So, there's no overflow yet. Nevertheless, if this behaviour
changes in the future, it could unintentionally, introduce a buffer
overflow. Additionally, some compiler or tools will detect this
potential overflow and complain about it.

Reviewed by: markj
Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com>
Reported-by: Andy Fiddaman <andy@omniosce.org>
Differential Revision: https://reviews.freebsd.org/D34689
(cherry picked from commit 45ddbf211274eb28c0ccd0042640de57015dd390)

Details

Provenance
corvinkAuthored on Apr 1 2022, 8:18 AM
manuCommitted on May 16 2022, 3:24 PM
Reviewer
markj
Differential Revision
D34689: bhyve: avoid overflow of BAR index
Parents
rG469a4e669d87: bhyve: avoid an empty passthru config value
Branches
Unknown
Tags
Unknown