Powered by Linux
Re: Adding PCI hotplug safe checking to smatch — Semantic Matching Tool

Re: Adding PCI hotplug safe checking to smatch

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

 



On Fri, Jan 24, 2014 at 01:43:47PM +0300, Dan Carpenter wrote:
> So I tried the first most obvious check which is to match code like
> this:
> 
> 	foo = readl();
> 
> If you see that then mark "foo" as untrusted.  Then if "foo" is used in
> a condition print an error.
> 
> 	if (foo & BAR) <-- Error.
> 
> I wasn't sure how to tell which drivers are hot plugable (plus I'm
> lazy) so I ran it on drivers/usb/.

Any PCI driver can have a device that goes away at any point in time.

USB devices never read directly from a memory location, they communicate
using "URBs" which are like network packets.  They fail if the device is
removed, and the driver is notified of that in the URB callback and in
the driver callback.

So that's probably not the best set of drivers to audit, with the
exception of the PCI USB host controllers (under drivers/usb/host/)

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe smatch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux