<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/hid.h, branch v3.4.105</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v3.4.105</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v3.4.105'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2014-04-14T13:44:18+00:00</updated>
<entry>
<title>HID: hidraw: add proper error handling to raw event reporting</title>
<updated>2014-04-14T13:44:18+00:00</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2012-04-26T22:56:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.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>HID: provide a helper for validating hid reports</title>
<updated>2013-10-01T16:10:51+00:00</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2013-09-11T19:56:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0049b62c9efc4ef23492976512d4722b3e63de45'/>
<id>urn:sha1:0049b62c9efc4ef23492976512d4722b3e63de45</id>
<content type='text'>
commit 331415ff16a12147d57d5c953f3a961b7ede348b upstream.

Many drivers need to validate the characteristics of their HID report
during initialization to avoid misusing the reports. This adds a common
helper to perform validation of the report exisitng, the field existing,
and the expected number of values within the field.

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>HID: validate HID report id size</title>
<updated>2013-09-27T00:15:34+00:00</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2013-08-28T20:29:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=676bb9a417ceec66576daeb24aed2184a82ef544'/>
<id>urn:sha1:676bb9a417ceec66576daeb24aed2184a82ef544</id>
<content type='text'>
commit 43622021d2e2b82ea03d883926605bdd0525e1d1 upstream.

The "Report ID" field of a HID report is used to build indexes of
reports. The kernel's index of these is limited to 256 entries, so any
malicious device that sets a Report ID greater than 255 will trigger
memory corruption on the host:

[ 1347.156239] BUG: unable to handle kernel paging request at ffff88094958a878
[ 1347.156261] IP: [&lt;ffffffff813e4da0&gt;] hid_register_report+0x2a/0x8b

CVE-2013-2888

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Merge branch 'hid-battery' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen into for-linus</title>
<updated>2012-01-09T10:24:59+00:00</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2012-01-09T10:24:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=420174afdc7023c000e5b5b1b6fe9e028470c713'/>
<id>urn:sha1:420174afdc7023c000e5b5b1b6fe9e028470c713</id>
<content type='text'>
</content>
</entry>
<entry>
<title>hid-input/battery: remove battery_val</title>
<updated>2012-01-08T07:31:18+00:00</updated>
<author>
<name>Jeremy Fitzhardinge</name>
<email>jeremy@goop.org</email>
</author>
<published>2011-12-03T05:57:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ce63920b395f1476e2d28cca16a56919289f0b62'/>
<id>urn:sha1:ce63920b395f1476e2d28cca16a56919289f0b62</id>
<content type='text'>
hidinput_get_battery_property() now directly polls the device for the
current battery strength, so there's no need for battery_val, or the
code to set it on the input event path.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
</content>
</entry>
<entry>
<title>hid-input/battery: deal with both FEATURE and INPUT report batteries</title>
<updated>2012-01-08T07:30:37+00:00</updated>
<author>
<name>Jeremy Fitzhardinge</name>
<email>jeremy@goop.org</email>
</author>
<published>2011-12-02T19:18:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fb8ac91b4dccbdda0ad51d499079d05143783ba4'/>
<id>urn:sha1:fb8ac91b4dccbdda0ad51d499079d05143783ba4</id>
<content type='text'>
Some devices seem to report batteries as FEATUREs, others as INPUTs.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
</content>
</entry>
<entry>
<title>hid-input/battery: add quirks for battery</title>
<updated>2012-01-08T07:30:37+00:00</updated>
<author>
<name>Jeremy Fitzhardinge</name>
<email>jeremy@goop.org</email>
</author>
<published>2011-12-02T19:12:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bbc21cfd55858d7c3e55bfaa91fa934b0b13ad4d'/>
<id>urn:sha1:bbc21cfd55858d7c3e55bfaa91fa934b0b13ad4d</id>
<content type='text'>
Some devices always report percentage, despite having 0/255 as their
min/max, so add a quirk for them.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
</content>
</entry>
<entry>
<title>hid-input: add support for HID devices reporting Battery Strength</title>
<updated>2012-01-08T07:30:34+00:00</updated>
<author>
<name>Daniel Nicoletti</name>
<email>dantti12@gmail.com</email>
</author>
<published>2011-12-02T05:52:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c5a92aa3eb7425da68797a820d208edad36551f7'/>
<id>urn:sha1:c5a92aa3eb7425da68797a820d208edad36551f7</id>
<content type='text'>
I've sent an email earlier asking for help with a GetFeature code, and now I
have a second patch on top of Jeremy's to provide the battery functionality
for devices that support reporting it.

If I understood correctly when talking to Jeremy he said his device
never actually reported the status as an input event (sorry if I didn't
understand it correctly), and after reading HID specs I believe it's
really because it was meant to be probed, I have an Apple Keyboard and
Magic Trackpad both bluetooth batteries operated, so using PacketLogger
I saw that Mac OSX always ask the battery status using the so called
GetFeature.

What my patch does is basically:
- store the report id that matches the battery_strength
- setup the battery if 0x6.0x20 is found, even if that is reported as a feature
  (as it was meant to be but only the MagicTrackpad does)
- when upower or someone access /sys/class/power_supply/hid-*/capacity it
  will probe the device and return it's status.

It works great for both devices, but I have two concerns:
- the report_features function has a duplicated code
- it would be nice if it was possible for specific drivers to provide their own
  probe as there might be some strange devices... (but maybe it's
already possible)

I've talked to the upower dev and he fixed it to be able to show the
right percentage.

Here how the uevent file (in /sys/class/power_supply/hid-*/) looks like:
POWER_SUPPLY_NAME=hid-00:22:41:D9:18:E7-battery
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_CAPACITY=66
POWER_SUPPLY_MODEL_NAME=MacAdmin’s keyboard
POWER_SUPPLY_STATUS=Discharging

POWER_SUPPLY_NAME=hid-70:CD:60:F5:FF:3F-battery
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_CAPACITY=62
POWER_SUPPLY_MODEL_NAME=nexx’s Trackpad
POWER_SUPPLY_STATUS=Discharging

Signed-off-by: Daniel Nicoletti &lt;dantti12@gmail.com&gt;
</content>
</entry>
<entry>
<title>Merge branches 'hyperv', 'multitouch', 'roccat', 'upstream', 'upstream-fixes', 'wacom' and 'wiimote' into for-linus</title>
<updated>2012-01-05T14:51:02+00:00</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2012-01-05T14:51:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e0273728564a395a13cfed70e34da4f2613d2d44'/>
<id>urn:sha1:e0273728564a395a13cfed70e34da4f2613d2d44</id>
<content type='text'>
</content>
</entry>
<entry>
<title>HID: usbhid: defer LED setting to a workqueue</title>
<updated>2011-12-21T10:18:35+00:00</updated>
<author>
<name>Daniel Kurtz</name>
<email>djkurtz@chromium.org</email>
</author>
<published>2011-11-17T11:23:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4371ea8202e98c8ef77ca887de3b19affbb3498f'/>
<id>urn:sha1:4371ea8202e98c8ef77ca887de3b19affbb3498f</id>
<content type='text'>
Defer LED setting action to a workqueue.
This is more likely to send all LED change events in a single URB.

Signed-off-by: Daniel Kurtz &lt;djkurtz@chromium.org&gt;
Acked-by: Oliver Neukum &lt;oneukum@suse.de&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
</feed>
