HomeFreeBSD

ixv: Check cap return before MSI-X enable write

Description

ixv: Check cap return before MSI-X enable write

In the QEMU workaround code in if_ixv.c, the ixv driver calls
pci_find_cap(dev, PCIY_MSIX, &rid). It is not checking the return code
from that function and the function appears to always be failing. This
then causes the driver to use the rid variable uninitialized, which
will mean setting a bit at an arbitrary offset in pci config space. For
now, this seems to have no adverse impact, but it could easily cause
very subtle problems.

PR: 207037
Sponsored by: BBOX.io

(cherry picked from commit b87b3696c973ef0a9df70143cd89f6b488531e93)

Details

Provenance
Jeremiah Lott <jlott@averesystems.com>Authored on Oct 27 2024, 7:18 AM
Kevin Bowling <kbowling@FreeBSD.org>Committed on Oct 30 2024, 1:02 AM
Parents
rG4f55232d2d32: Fix gcc uninitialized warning in FreeBSD zio_crypt.c
Branches
Unknown
Tags
Unknown

Event Timeline

Kevin Bowling <kbowling@FreeBSD.org> committed rG453f85caa93a: ixv: Check cap return before MSI-X enable write (authored by Jeremiah Lott <jlott@averesystems.com>).Oct 30 2024, 1:02 AM