<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/hid/hid-debug.c, branch v5.14</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.14</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.14'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2021-06-30T07:03:51Z</updated>
<entry>
<title>Merge branch 'for-5.14/core' into for-linus</title>
<updated>2021-06-30T07:03:51Z</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2021-06-30T07:03:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fd73788ce6a580f2bd353e0f364d31b6c16dcd12'/>
<id>urn:sha1:fd73788ce6a580f2bd353e0f364d31b6c16dcd12</id>
<content type='text'>
- device unbinding locking fix from Dmitry Torokhov
- support for programmable buttons (mapping to KEY_MACRO# event codes)
  from Thomas Weißschuh
- various other small fixes and code style improvements
</content>
</entry>
<entry>
<title>HID: input: Add support for Programmable Buttons</title>
<updated>2021-06-24T13:40:59Z</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2021-06-15T21:41:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bcfa8d14570d85c998a9b706b074ab151b286edf'/>
<id>urn:sha1:bcfa8d14570d85c998a9b706b074ab151b286edf</id>
<content type='text'>
Map them to KEY_MACRO# event codes.

These buttons are defined by HID as follows:
"The user defines the function of these buttons to control software applications or GUI objects."

This matches the semantics of the KEY_MACRO# input event codes that Linux supports.

Also add support for HID "Named Array" collections.
Also add hid-debug support for KEY_MACRO#.

Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hid-debug: recognize KEY_ASSISTANT and KEY_KBD_LAYOUT_NEXT</title>
<updated>2021-05-05T12:31:05Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2021-04-11T02:56:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0f0fb3d27e5ba51e40f2af4288efeaf3d293ef1a'/>
<id>urn:sha1:0f0fb3d27e5ba51e40f2af4288efeaf3d293ef1a</id>
<content type='text'>
Add missing descriptions for KEY_ASSISTANT and KEY_KBD_LAYOUT_NEXT.

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hid-input: add mapping for emoji picker key</title>
<updated>2021-05-05T12:31:05Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2021-04-11T02:56:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7b229b13d78d112e2c5d4a60a3c6f602289959fa'/>
<id>urn:sha1:7b229b13d78d112e2c5d4a60a3c6f602289959fa</id>
<content type='text'>
HUTRR101 added a new usage code for a key that is supposed to invoke and
dismiss an emoji picker widget to assist users to locate and enter emojis.

This patch adds a new key definition KEY_EMOJI_PICKER and maps 0x0c/0x0d9
usage code to this new keycode. Additionally hid-debug is adjusted to
recognize this new usage code as well.

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: input: map battery capacity (00850065)</title>
<updated>2021-04-07T11:15:17Z</updated>
<author>
<name>John Chen</name>
<email>johnchen902@gmail.com</email>
</author>
<published>2021-03-30T11:33:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9de07a4e8d4cb269f9876b2ffa282b5ffd09e05b'/>
<id>urn:sha1:9de07a4e8d4cb269f9876b2ffa282b5ffd09e05b</id>
<content type='text'>
This is the capacity in percentage, relative to design capacity.
Specifically, it is present in Apple Magic Mouse 2.

In contrast, usage 00850064 is also the capacity in percentage, but is
relative to full capacity. It is not mapped here because I don't have
such device.

Signed-off-by: John Chen &lt;johnchen902@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hid-debug: fix nonblocking read semantics wrt EIO/ERESTARTSYS</title>
<updated>2020-09-09T06:47:38Z</updated>
<author>
<name>Laurent Gauthier</name>
<email>laurent.gauthier@soccasys.com</email>
</author>
<published>2020-09-08T22:11:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c27e08820bc6cb7d483a8d87589bdbbbf10f2306'/>
<id>urn:sha1:c27e08820bc6cb7d483a8d87589bdbbbf10f2306</id>
<content type='text'>
When the file has been open in non-blocking mode, EIO or ERESTARTSYS
would never be returned even if they should (for example when device
has been unplugged, you want EIO and not EAGAIN to be returned).

Move the O_NONBLOCK check after other checks have been performed.

Based on similar to patches hidraw and hiddev by Founder Fang
&lt;founder.fang@gmail.com&gt; and Jiri Kosina &lt;jkosina@suse.cz&gt;.

Signed-off-by: Laurent Gauthier &lt;laurent.gauthier@soccasys.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156</title>
<updated>2019-05-30T18:26:35Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-05-27T06:55:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1a59d1b8e05ea6ab45f7e18897de1ef0e6bc3da6'/>
<id>urn:sha1:1a59d1b8e05ea6ab45f7e18897de1ef0e6bc3da6</id>
<content type='text'>
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license as published by
  the free software foundation either version 2 of the license or at
  your option any later version this program is distributed in the
  hope that it will be useful but without any warranty without even
  the implied warranty of merchantability or fitness for a particular
  purpose see the gnu general public license for more details you
  should have received a copy of the gnu general public license along
  with this program if not write to the free software foundation inc
  59 temple place suite 330 boston ma 02111 1307 usa

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 1334 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Reviewed-by: Richard Fontana &lt;rfontana@redhat.com&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>HID: debug: fix race condition with between rdesc_show() and device removal</title>
<updated>2019-03-19T14:41:08Z</updated>
<author>
<name>He, Bo</name>
<email>bo.he@intel.com</email>
</author>
<published>2019-03-14T02:28:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cef0d4948cb0a02db37ebfdc320e127c77ab1637'/>
<id>urn:sha1:cef0d4948cb0a02db37ebfdc320e127c77ab1637</id>
<content type='text'>
There is a race condition that could happen if hid_debug_rdesc_show()
is running while hdev is in the process of going away (device removal,
system suspend, etc) which could result in NULL pointer dereference:

	 BUG: unable to handle kernel paging request at 0000000783316040
	 CPU: 1 PID: 1512 Comm: getevent Tainted: G     U     O 4.19.20-quilt-2e5dc0ac-00029-gc455a447dd55 #1
	 RIP: 0010:hid_dump_device+0x9b/0x160
	 Call Trace:
	  hid_debug_rdesc_show+0x72/0x1d0
	  seq_read+0xe0/0x410
	  full_proxy_read+0x5f/0x90
	  __vfs_read+0x3a/0x170
	  vfs_read+0xa0/0x150
	  ksys_read+0x58/0xc0
	  __x64_sys_read+0x1a/0x20
	  do_syscall_64+0x55/0x110
	  entry_SYSCALL_64_after_hwframe+0x49/0xbe

Grab driver_input_lock to make sure the input device exists throughout the
whole process of dumping the rdesc.

[jkosina@suse.cz: update changelog a bit]
Signed-off-by: he, bo &lt;bo.he@intel.com&gt;
Signed-off-by: "Zhang, Jun" &lt;jun.zhang@intel.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: debug: fix the ring buffer implementation</title>
<updated>2019-01-29T11:09:11Z</updated>
<author>
<name>Vladis Dronov</name>
<email>vdronov@redhat.com</email>
</author>
<published>2019-01-29T10:58:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=13054abbaa4f1fd4e6f3b4b63439ec033b4c8035'/>
<id>urn:sha1:13054abbaa4f1fd4e6f3b4b63439ec033b4c8035</id>
<content type='text'>
Ring buffer implementation in hid_debug_event() and hid_debug_events_read()
is strange allowing lost or corrupted data. After commit 717adfdaf147
("HID: debug: check length before copy_to_user()") it is possible to enter
an infinite loop in hid_debug_events_read() by providing 0 as count, this
locks up a system. Fix this by rewriting the ring buffer implementation
with kfifo and simplify the code.

This fixes CVE-2019-3819.

v2: fix an execution logic and add a comment
v3: use __set_current_state() instead of set_current_state()

Link: https://bugzilla.redhat.com/show_bug.cgi?id=1669187
Cc: stable@vger.kernel.org # v4.18+
Fixes: cd667ce24796 ("HID: use debugfs for events/reports dumping")
Fixes: 717adfdaf147 ("HID: debug: check length before copy_to_user()")
Signed-off-by: Vladis Dronov &lt;vdronov@redhat.com&gt;
Reviewed-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Signed-off-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
</content>
</entry>
<entry>
<title>HID: debug: Change to use DEFINE_SHOW_ATTRIBUTE macro</title>
<updated>2018-12-19T13:20:14Z</updated>
<author>
<name>Yangtao Li</name>
<email>tiny.windzz@gmail.com</email>
</author>
<published>2018-12-01T02:49:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8c32d47b151b675291ca4278bfce0ec3eb46fad8'/>
<id>urn:sha1:8c32d47b151b675291ca4278bfce0ec3eb46fad8</id>
<content type='text'>
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li &lt;tiny.windzz@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
</feed>
