From: Alexey V. Vissarionov Date: Sun, 18 Dec 2022 03:33:47 +0000 (+0300) Subject: PCI/IOV: Enlarge virtfn sysfs name buffer X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ea0b5aa5f184cf8293c93163f0fb00505190d431;p=linux.git PCI/IOV: Enlarge virtfn sysfs name buffer The sysfs link name "virtfn%u" constructed by pci_iov_sysfs_link() requires 17 bytes to contain the longest possible string. Increase VIRTFN_ID_LEN to accommodate that. Found by Linux Verification Center (linuxtesting.org) with SVACE. [bhelgaas: commit log, comment at #define] Fixes: dd7cc44d0bce ("PCI: add SR-IOV API for Physical Function driver") Link: https://lore.kernel.org/r/20221218033347.23743-1-gremlin@altlinux.org Signed-off-by: Alexey V. Vissarionov Signed-off-by: Bjorn Helgaas --- diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 952217572113c..b2e8322755c17 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -14,7 +14,7 @@ #include #include "pci.h" -#define VIRTFN_ID_LEN 16 +#define VIRTFN_ID_LEN 17 /* "virtfn%u\0" for 2^32 - 1 */ int pci_iov_virtfn_bus(struct pci_dev *dev, int vf_id) {