summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/errfile.h
diff options
context:
space:
mode:
authorMichael Brown2022-09-15 16:04:01 +0200
committerMichael Brown2022-09-15 16:20:58 +0200
commit56b30364c5db6367279ffe88929f286f15680b40 (patch)
tree0062a8909e99c573d3c421d7d73a8321bff289f0 /src/include/ipxe/errfile.h
parent[pci] Allow pci_find_next() to return non-zero PCI segments (diff)
downloadipxe-56b30364c5db6367279ffe88929f286f15680b40.tar.gz
ipxe-56b30364c5db6367279ffe88929f286f15680b40.tar.xz
ipxe-56b30364c5db6367279ffe88929f286f15680b40.zip
[pci] Check for wraparound in callers of pci_find_next()
The semantics of the bus:dev.fn parameter passed to pci_find_next() are "find the first existent PCI device at this address or higher", with the caller expected to increment the address between finding devices. This does not allow the parameter to distinguish between the two cases "start from address zero" and "wrapped after incrementing maximal possible address", which could therefore lead to an infinite loop in the degenerate case that a device with address ffff:ff:1f.7 really exists. Fix by checking for wraparound in the caller (which is already responsible for performing the increment). Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/errfile.h')
-rw-r--r--src/include/ipxe/errfile.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/ipxe/errfile.h b/src/include/ipxe/errfile.h
index 359e4d2c..9b955e57 100644
--- a/src/include/ipxe/errfile.h
+++ b/src/include/ipxe/errfile.h
@@ -397,6 +397,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define ERRFILE_linux_sysfs ( ERRFILE_OTHER | 0x00560000 )
#define ERRFILE_linux_acpi ( ERRFILE_OTHER | 0x00570000 )
#define ERRFILE_dynkeymap ( ERRFILE_OTHER | 0x00580000 )
+#define ERRFILE_pci_cmd ( ERRFILE_OTHER | 0x00590000 )
/** @} */