<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/hid/hidraw.c, branch linux-3.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-04-14T13:44:19Z</updated>
<entry>
<title>HID: hidraw: correctly deallocate memory on device disconnect</title>
<updated>2014-04-14T13:44:19Z</updated>
<author>
<name>Manoj Chourasia</name>
</author>
<published>2013-07-22T10:03:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7c5b2352dbd302fa2940973af841ba9be39502f6'/>
<id>urn:sha1:7c5b2352dbd302fa2940973af841ba9be39502f6</id>
<content type='text'>
commit 212a871a3934beccf43431608c27ed2e05a476ec upstream.

This changes puts the commit 4fe9f8e203f back in place
with the fixes for slab corruption because of the commit.

When a device is unplugged, wait for all processes that
have opened the device to close before deallocating the device.

This commit was solving kernel crash because of the corruption in
rb tree of vmalloc. The rootcause was the device data pointer was
geting excessed after the memory associated with hidraw was freed.

The commit 4fe9f8e203f was buggy as it was also freeing the hidraw
first and then calling delete operation on the list associated with
that hidraw leading to slab corruption.

Signed-off-by: Manoj Chourasia &lt;mchourasia@nvidia.com&gt;
Tested-by: Peter Wu &lt;lekensteyn@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Cc: Yijing Wang &lt;wangyijing@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>HID: hidraw: improve error handling in hidraw_init()</title>
<updated>2014-04-14T13:44:18Z</updated>
<author>
<name>Alexey Khoroshilov</name>
</author>
<published>2012-08-15T19:31:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7fc19240123296c99b003806fe75cfb19c0ad54a'/>
<id>urn:sha1:7fc19240123296c99b003806fe75cfb19c0ad54a</id>
<content type='text'>
commit bcb4a75bde3821cecb17a71d287abfd6ef9bd68d upstream.

Several improvements in error handling:
- do not report success if alloc_chrdev_region() failed
- check for error code of cdev_add()
- use unregister_chrdev_region() instead of unregister_chrdev()
  if class_create() failed

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov &lt;khoroshilov@ispras.ru&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Cc: Yijing Wang &lt;wangyijing@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>HID: hidraw: fix list-&gt;buffer memleak</title>
<updated>2014-04-14T13:44:18Z</updated>
<author>
<name>Matthieu CASTET</name>
</author>
<published>2012-06-28T14:51:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a6cec16f2227453df9143e47ac008301d6966e93'/>
<id>urn:sha1:a6cec16f2227453df9143e47ac008301d6966e93</id>
<content type='text'>
commit 4c7b417ecb756e85dfc955b0e7a04fd45585533e upstream.

If we don't read fast enough hidraw device, hidraw_report_event
will cycle and we will leak list-&gt;buffer.
Also list-&gt;buffer are not free on release.
After this patch, kmemleak report nothing.

Signed-off-by: Matthieu CASTET &lt;matthieu.castet@parrot.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Cc: Yijing Wang &lt;wangyijing@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>HID: hidraw: add proper error handling to raw event reporting</title>
<updated>2014-04-14T13:44:18Z</updated>
<author>
<name>Jiri Kosina</name>
</author>
<published>2012-04-26T22:56:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=588256df90f26647828489e45d82b72e97d624e9'/>
<id>urn:sha1:588256df90f26647828489e45d82b72e97d624e9</id>
<content type='text'>
commit b6787242f32700377d3da3b8d788ab3928bab849 upstream.

If kmemdup() in hidraw_report_event() fails, we are not propagating
this fact properly.

Let hidraw_report_event() and hid_report_raw_event() return an error
value to the caller.

Reported-by: Oliver Neukum &lt;oneukum@suse.de&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Cc: Yijing Wang &lt;wangyijing@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Merge branch 'upstream' into for-linus</title>
<updated>2011-10-25T07:59:04Z</updated>
<author>
<name>Jiri Kosina</name>
</author>
<published>2011-10-25T07:59:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b3aec7b686329e6bb65aa08c7f9458f7fd512f06'/>
<id>urn:sha1:b3aec7b686329e6bb65aa08c7f9458f7fd512f06</id>
<content type='text'>
Conflicts:
	drivers/hid/hid-core.c
	drivers/hid/hid-ids.h
</content>
</entry>
<entry>
<title>HID: hidraw: open count should not increase if error</title>
<updated>2011-09-27T16:42:22Z</updated>
<author>
<name>Amit Nagal</name>
</author>
<published>2011-09-27T17:41:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f554ff80339b4005856e6a86454d6ea2bb962ee5'/>
<id>urn:sha1:f554ff80339b4005856e6a86454d6ea2bb962ee5</id>
<content type='text'>
In hidraw_open, if hid_hw_power returns with error, hidraw device open count
should not increase.

Signed-off-by: Amit Nagal &lt;helloin.amit@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hidraw: protect hidraw_disconnect() better</title>
<updated>2011-09-20T13:23:46Z</updated>
<author>
<name>James Hogan</name>
</author>
<published>2011-09-20T13:23:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=65b01bd561dc995aab116aa784f97a37f7c49a65'/>
<id>urn:sha1:65b01bd561dc995aab116aa784f97a37f7c49a65</id>
<content type='text'>
The function hidraw_disconnect() only acquires the hidraw minors_lock
when clearing the entry in hidraw_table. However the device_destroy()
call can cause a userland read/write to return with an error. It may
cause the program to release the file descripter before the disconnect
is finished. hidraw_disconnect() has already set hidraw-&gt;exist to 0,
which makes hidraw_release() kfree the hidraw structure, which
hidraw_disconnect() continues to access and even tries to kfree again.
Similarly if a hidraw_release() occurs after setting hidraw-&gt;exist to 0,
the same thing can happen.

This is fixed by expanding the mutex critical section to cover the whole
function from setting hidraw-&gt;exist to 0 to freeing the hidraw
structure, preventing a hidraw_release() from interfering.

Signed-off-by: James Hogan &lt;james.hogan@imgtec.com&gt;
Tested-by: David Herrmann &lt;dh.herrmann@googlemail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hidraw: free list for all error in hidraw_open</title>
<updated>2011-09-07T11:48:47Z</updated>
<author>
<name>Amit Nagal</name>
</author>
<published>2011-09-07T11:48:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1a8962317f494ad858971fc08ba035eff658a5c9'/>
<id>urn:sha1:1a8962317f494ad858971fc08ba035eff658a5c9</id>
<content type='text'>
In function hidraw_open struct hidraw_list *list should be freed for
all error conditions.

Signed-off-by: Amit Nagal &lt;helloin.amit@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: 'name' and 'phys' in 'struct hid_device' can never be NULL</title>
<updated>2011-05-18T11:23:31Z</updated>
<author>
<name>Daniel Mack</name>
</author>
<published>2011-05-15T16:07:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dd2ed487fdd78b50549b2ca8418875c0d9f4a30e'/>
<id>urn:sha1:dd2ed487fdd78b50549b2ca8418875c0d9f4a30e</id>
<content type='text'>
As they are static members of fix size, there is no need to NULL-check them.

Signed-off-by: Daniel Mack &lt;zonque@gmail.com&gt;
Cc: Dmitry Torokhov &lt;dtor@mail.ru&gt;
Cc: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hidraw: fix comments</title>
<updated>2011-03-27T18:30:32Z</updated>
<author>
<name>Jiri Kosina</name>
</author>
<published>2011-03-27T18:29:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d2a1cfebe38edc0bbac8f5cfbce062fe3d146d7a'/>
<id>urn:sha1:d2a1cfebe38edc0bbac8f5cfbce062fe3d146d7a</id>
<content type='text'>
Adjust the comments a little bit.

Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
</feed>
