Unchecked user argument in ehci-dbg.c debug_lpm_write()?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

drivers/usb/host/ehci-dbg.c git HEAD has:

	if (strncmp(buf, "enable", 5) == 0) {
		if (strict_strtoul(buf + 7, 10, &port))
			return -EINVAL;
		params = ehci_readl(ehci, &ehci->caps->hcs_params);
		if (port > HCS_N_PORTS(params)) {
			ehci_dbg(ehci, "ERR: LPM on bad port %lu\n", port);
			return -ENODEV;
		}
debug>>>>>		ehci_dbg(ehci, "port is %d\n", port);
		portsc = &ehci->regs->port_status[port-1];
		temp = ehci_readl(ehci, portsc);
		if (!(temp & PORT_DEV_ADDR)) {
			ehci_dbg(ehci, "LPM: no device attached\n");
			return -ENODEV;
		}


And I get:

# echo "enable 0" > lpm 
bash: echo: Schreibfehler: Kein passendes Gerät gefunden.

# dmesg|tail
ehci_hcd 0000:00:10.3: port is 0
ehci_hcd 0000:00:10.3: LPM: no device attached

Houston?


Admittedly this debug file certainly is not exactly hotpath...


[note that this broken access is repeated in "disable" branch, too]


Found while trying to debug a failing (device descriptor ETIMEDOUT
on EHCI 2.0 vs. WORKING with interim 1.1 passive hub) CnMemory USB3.0 2TB
ASMedia, connected to VIA VT8235 USB2.0.
Now going to attempt to hopefully tweak ehci-pci.c into submission,
and some other tests.

HTH,

Andreas Mohr
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux