Re: HIDDEV: potential NULL dereference

From
Jiri Kosina <hidden>
Date
2010-09-13 15:02:34
Also in
lkml
On Thu, 9 Sep 2010, anil joshi wrote:

On Thu, Sep 9, 2010 at 7:59 PM, anil joshi [off-list ref] wrote:
       hid->dev.parent is "usb_interfae"  pointer is kfree  in  usb_release_interfece 
hid_to_usb_dev(dev) accessing hid->dev.parent 

I have tested this,while removing  hid device  

usb_release_interfece is belonging to khubd  process 

I get many use full information  from  Jiri Kosina, Markus Trippelsdorf, regarding this issue
from http://kerneltrap.org/mailarchive/linux-kernel/2010/8/12/4606155/thread#mid-4606155

To avoid  NULL deference problem 

hiddev->exist is zero before usb_deregister_dev  call in  hiddev_disconnected  function there fore
we could use
static long hiddev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{


     if (hiddev->exist) {
         hid_to_usb_dev(dev);
       } else {
            return -EIO
   }


Thanks to Markus Trippelsdorf , Jiri Kosina 
Hi Anil,

could you please send a proper patch (diff against current kernel) and a 
short changelog entry with the explanation, so that I could easily 
understand what you are proposing?

Thanks!

-- 
Jiri Kosina
SUSE Labs, Novell Inc.
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thread (1 message) 1 message, 1 author, last reply 2010-09-13
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help