git: 5f275e547814 - main - cxgbev(4): verify the vendor id before claiming a device
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 01 Oct 2026 21:19:27 UTC
The branch main has been updated by np:
URL: https://cgit.FreeBSD.org/src/commit/?id=5f275e547814db5944ff1ca746c31447a0896e1e
commit 5f275e547814db5944ff1ca746c31447a0896e1e
Author: Navdeep Parhar <np@FreeBSD.org>
AuthorDate: 2026-10-01 16:16:10 +0000
Commit: Navdeep Parhar <np@FreeBSD.org>
CommitDate: 2026-10-01 21:09:51 +0000
cxgbev(4): verify the vendor id before claiming a device
PR: 299002
Reviewed by: jhb
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D60203
---
sys/dev/cxgbe/t4_vf.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/sys/dev/cxgbe/t4_vf.c b/sys/dev/cxgbe/t4_vf.c
index 89dae02e9332..8e9d3b34d6a2 100644
--- a/sys/dev/cxgbe/t4_vf.c
+++ b/sys/dev/cxgbe/t4_vf.c
@@ -160,9 +160,13 @@ static struct cdevsw t4vf_cdevsw = {
static int
t4vf_probe(device_t dev)
{
- uint16_t d;
+ uint16_t d, v;
size_t i;
+ v = pci_get_vendor(dev);
+ if (v != PCI_VENDOR_ID_CHELSIO)
+ return (ENXIO);
+
d = pci_get_device(dev);
for (i = 0; i < nitems(t4vf_pciids); i++) {
if (d == t4vf_pciids[i].device) {
@@ -176,9 +180,13 @@ t4vf_probe(device_t dev)
static int
t5vf_probe(device_t dev)
{
- uint16_t d;
+ uint16_t d, v;
size_t i;
+ v = pci_get_vendor(dev);
+ if (v != PCI_VENDOR_ID_CHELSIO)
+ return (ENXIO);
+
d = pci_get_device(dev);
for (i = 0; i < nitems(t5vf_pciids); i++) {
if (d == t5vf_pciids[i].device) {
@@ -192,9 +200,13 @@ t5vf_probe(device_t dev)
static int
t6vf_probe(device_t dev)
{
- uint16_t d;
+ uint16_t d, v;
size_t i;
+ v = pci_get_vendor(dev);
+ if (v != PCI_VENDOR_ID_CHELSIO)
+ return (ENXIO);
+
d = pci_get_device(dev);
for (i = 0; i < nitems(t6vf_pciids); i++) {
if (d == t6vf_pciids[i].device) {
@@ -208,9 +220,13 @@ t6vf_probe(device_t dev)
static int
chvf_probe(device_t dev)
{
- uint16_t d;
+ uint16_t d, v;
size_t i;
+ v = pci_get_vendor(dev);
+ if (v != PCI_VENDOR_ID_CHELSIO)
+ return (ENXIO);
+
d = pci_get_device(dev);
for (i = 0; i < nitems(t7vf_pciids); i++) {
if (d == t7vf_pciids[i].device) {