mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
PCI: Check dynids driver_data value for validity
Only accept dynids whose driver_data value matches one of the driver's pci_driver_id entries. This prevents the user from accidentally passing values the drivers do not expect. Cc: Milton Miller <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Jean Delvare <[email protected]> Signed-off-by: Jesse Barnes <[email protected]>
This commit is contained in:
parent
edbc25caaa
commit
b41d6cf38e
4 changed files with 20 additions and 10 deletions
|
|
@ -332,10 +332,6 @@ static int __devinit amd756_probe(struct pci_dev *pdev,
|
|||
int error;
|
||||
u8 temp;
|
||||
|
||||
/* driver_data might come from user-space, so check it */
|
||||
if (id->driver_data >= ARRAY_SIZE(chipname))
|
||||
return -EINVAL;
|
||||
|
||||
if (amd756_ioport) {
|
||||
dev_err(&pdev->dev, "Only one device supported "
|
||||
"(you have a strange motherboard, btw)\n");
|
||||
|
|
|
|||
|
|
@ -332,10 +332,6 @@ static int __devinit vt596_probe(struct pci_dev *pdev,
|
|||
unsigned char temp;
|
||||
int error = -ENODEV;
|
||||
|
||||
/* driver_data might come from user-space, so check it */
|
||||
if (id->driver_data & 1 || id->driver_data > 0xff)
|
||||
return -EINVAL;
|
||||
|
||||
/* Determine the address of the SMBus areas */
|
||||
if (force_addr) {
|
||||
vt596_smba = force_addr & 0xfff0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue