git: a8c7eefc86bf - stable/15 - cxgbev(4): verify the vendor id before claiming a device

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Fri, 30 Oct 2026 17:37:18 UTC
The branch stable/15 has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=a8c7eefc86bf0689f3ec8f4c9fd80328e0267d96

commit a8c7eefc86bf0689f3ec8f4c9fd80328e0267d96
Author:     Navdeep Parhar <np@FreeBSD.org>
AuthorDate: 2026-10-01 16:16:10 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-10-30 17:37:05 +0000

    cxgbev(4): verify the vendor id before claiming a device
    
    PR:             299002
    Reviewed by:    jhb
    Sponsored by:   Chelsio Communications
    Differential Revision:  https://reviews.freebsd.org/D60203
    
    (cherry picked from commit 5f275e547814db5944ff1ca746c31447a0896e1e)
---
 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) {