lkml.org 
[lkml]   [2013]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] hidraw: correctly deallocate memory on device disconnect
Date
On Friday 09 August 2013 11:31:15 Jiri Kosina wrote:
> On Mon, 22 Jul 2013, Manoj Chourasia wrote:
> > This is mail is in regard to your commit for hidaw devices. We were
> > seeing kernel crashes while connect and disconnect a hidraw device and
> > we were hitting rb tree corruption in vmalloc and kernel was crashing
> > because of null pointer de-reference. Later we figure out that was
> > because the hid device disconnect is freeing memory which later got
> > access by hidraw_read and hid_write.
>
> Now applied, thanks Manoj, thanks Peter.

I just noticed an issue with this patch, after playing with some receivers I
saw 8 hidraw device nodes. Every USB receiver creates two hidraw nodes, one
for the receiver and one for the paired device.

UPower seems to keep the file descriptor open which prevents the hidraw device
from being removed. Shouldn't the implementation of hidraw be changed to
separate open file descriptors from the actual HID devices? That should allow
/dev/hidrawX devices to get removed whenever a HID device is gone.

Regards,
Peter


\
 
 \ /
  Last update: 2013-08-20 17:01    [W:0.103 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site