diff options
author | avg <avg@FreeBSD.org> | 2009-09-11 18:48:49 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2009-09-11 18:48:49 +0000 |
commit | 75d000f4cedbe5d5e381c135f97120e3ecad9be1 (patch) | |
tree | 21fdb9731712db3d8844a9fcb3349c5db249031a /sys | |
parent | 972d9b272230173e6ef0275570d6cc08fe5163c9 (diff) | |
download | FreeBSD-src-75d000f4cedbe5d5e381c135f97120e3ecad9be1.zip FreeBSD-src-75d000f4cedbe5d5e381c135f97120e3ecad9be1.tar.gz |
pci(4): don't perform maximum register number check
Different sub-kinds of PCI buses may have different rules and
thus it is up for the bus backends to do proper input checks.
For example, PCIe allows configuration register numbers < 0x1000,
while for PCI proper the limit is 0x100.
And, in fact, the buses already do the checks.
Reviewed by: jhb
MFC after: 1 week
X-ToDo: add check for negative value to bus backends
X-ToDo: use named constant for maximum PCIe register
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/pci_user.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/dev/pci/pci_user.c b/sys/dev/pci/pci_user.c index ed75353..8ab0a01 100644 --- a/sys/dev/pci/pci_user.c +++ b/sys/dev/pci/pci_user.c @@ -605,9 +605,8 @@ getconfexit: case 4: case 2: case 1: - /* Make sure register is in bounds and aligned. */ + /* Make sure register is not negative and aligned. */ if (io->pi_reg < 0 || - io->pi_reg + io->pi_width > PCI_REGMAX + 1 || io->pi_reg & (io->pi_width - 1)) { error = EINVAL; break; |