<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/bluetooth/hidp/core.c, branch linux-3.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-09-26T06:33:54Z</updated>
<entry>
<title>Bluetooth: hidp: Fix handling of strncpy for hid-&gt;name information</title>
<updated>2018-09-26T06:33:54Z</updated>
<author>
<name>Marcel Holtmann</name>
</author>
<published>2018-07-30T11:57:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=128b37430eb5113155e0db556cb903aa4220fdf3'/>
<id>urn:sha1:128b37430eb5113155e0db556cb903aa4220fdf3</id>
<content type='text'>
[ Upstream commit b3cadaa485f0c20add1644a5c877b0765b285c0c ]

This fixes two issues with setting hid-&gt;name information.

  CC      net/bluetooth/hidp/core.o
In function ‘hidp_setup_hid’,
    inlined from ‘hidp_session_dev_init’ at net/bluetooth/hidp/core.c:815:9,
    inlined from ‘hidp_session_new’ at net/bluetooth/hidp/core.c:953:8,
    inlined from ‘hidp_connection_add’ at net/bluetooth/hidp/core.c:1366:8:
net/bluetooth/hidp/core.c:778:2: warning: ‘strncpy’ output may be truncated copying 127 bytes from a string of length 127 [-Wstringop-truncation]
  strncpy(hid-&gt;name, req-&gt;name, sizeof(req-&gt;name) - 1);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  CC      net/bluetooth/hidp/core.o
net/bluetooth/hidp/core.c: In function ‘hidp_setup_hid’:
net/bluetooth/hidp/core.c:778:38: warning: argument to ‘sizeof’ in ‘strncpy’ call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
  strncpy(hid-&gt;name, req-&gt;name, sizeof(req-&gt;name));
                                      ^

Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: hidp: buffer overflow in hidp_process_report</title>
<updated>2018-08-17T18:54:56Z</updated>
<author>
<name>Mark Salyzyn</name>
</author>
<published>2018-07-31T22:02:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=adfdcfe1c7cd5f163855b0d3ea5d3a75efddd576'/>
<id>urn:sha1:adfdcfe1c7cd5f163855b0d3ea5d3a75efddd576</id>
<content type='text'>
commit 7992c18810e568b95c869b227137a2215702a805 upstream.

CVE-2018-9363

The buffer length is unsigned at all layers, but gets cast to int and
checked in hidp_process_report and can lead to a buffer overflow.
Switch len parameter to unsigned int to resolve issue.

This affects 3.18 and newer kernels.

Signed-off-by: Mark Salyzyn &lt;salyzyn@android.com&gt;
Fixes: a4b1b5877b514b276f0f31efe02388a9c2836728 ("HID: Bluetooth: hidp: make sure input buffers are big enough")
Cc: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Cc: Johan Hedberg &lt;johan.hedberg@gmail.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Cc: linux-bluetooth@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: security@kernel.org
Cc: kernel-team@android.com
Acked-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Bluetooth: hidp: fix possible might sleep error in hidp_session_thread</title>
<updated>2017-08-30T08:16:57Z</updated>
<author>
<name>Jeffy Chen</name>
</author>
<published>2017-06-27T09:34:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=81baf8c59bd8278350c5bbd8d690a8f038b39929'/>
<id>urn:sha1:81baf8c59bd8278350c5bbd8d690a8f038b39929</id>
<content type='text'>
commit 5da8e47d849d3d37b14129f038782a095b9ad049 upstream.

It looks like hidp_session_thread has same pattern as the issue reported in
old rfcomm:

	while (1) {
		set_current_state(TASK_INTERRUPTIBLE);
		if (condition)
			break;
		// may call might_sleep here
		schedule();
	}
	__set_current_state(TASK_RUNNING);

Which fixed at:
	dfb2fae Bluetooth: Fix nested sleeps

So let's fix it at the same way, also follow the suggestion of:
https://lwn.net/Articles/628628/

Signed-off-by: Jeffy Chen &lt;jeffy.chen@rock-chips.com&gt;
Tested-by: AL Yu-Chen Cho &lt;acho@suse.com&gt;
Tested-by: Rohit Vaswani &lt;rvaswani@nvidia.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Cc: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Bluetooth: Improve *_get() functions to return the object type</title>
<updated>2014-09-08T17:07:52Z</updated>
<author>
<name>Johan Hedberg</name>
</author>
<published>2014-08-15T18:06:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=51bb8457ddfa74ede52bf8c02054dea831d59fff'/>
<id>urn:sha1:51bb8457ddfa74ede52bf8c02054dea831d59fff</id>
<content type='text'>
It's natural to have *_get() functions that increment the reference
count of an object to return the object type itself. This way it's
simple to make a copy of the object pointer and increase the reference
count in a single step. This patch updates two such get() functions,
namely hci_conn_get() and l2cap_conn_get(), and updates the users to
take advantage of the new API.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Fix sparse warning from HID new leds handling</title>
<updated>2014-07-30T17:28:41Z</updated>
<author>
<name>Marcel Holtmann</name>
</author>
<published>2014-07-30T06:08:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bdb9434664d026ea63ad086443160dd4ed347758'/>
<id>urn:sha1:bdb9434664d026ea63ad086443160dd4ed347758</id>
<content type='text'>
The new leds bit handling produces this spares warning.

  CHECK   net/bluetooth/hidp/core.c
net/bluetooth/hidp/core.c:156:60: warning: dubious: x | !y

Just fix it by doing an explicit x &lt;&lt; 0 shift operation.

Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-linus</title>
<updated>2014-04-01T17:05:09Z</updated>
<author>
<name>Jiri Kosina</name>
</author>
<published>2014-04-01T17:05:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ad295b6d5739ab24880a31be403bbc8fab62e177'/>
<id>urn:sha1:ad295b6d5739ab24880a31be403bbc8fab62e177</id>
<content type='text'>
Conflicts:
	drivers/hid/hid-ids.h
	drivers/hid/hid-sony.c
	drivers/hid/i2c-hid/i2c-hid.c
</content>
</entry>
<entry>
<title>Merge branch 'for-3.15/ll-driver-new-callbacks' into for-linus</title>
<updated>2014-04-01T16:56:24Z</updated>
<author>
<name>Jiri Kosina</name>
</author>
<published>2014-04-01T16:56:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ee5f68e6c2f183e6aade0e9c57af13d5eff44f2f'/>
<id>urn:sha1:ee5f68e6c2f183e6aade0e9c57af13d5eff44f2f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>HID: remove hid_output_raw_report transport implementations</title>
<updated>2014-03-14T14:30:24Z</updated>
<author>
<name>Benjamin Tissoires</name>
</author>
<published>2014-03-09T03:52:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6fd182028c43baf1c7d017d52b0134ecadbdc447'/>
<id>urn:sha1:6fd182028c43baf1c7d017d52b0134ecadbdc447</id>
<content type='text'>
Nobody calls hid_output_raw_report anymore, and nobody should.
We can now remove the various implementation in the different
transport drivers and the declarations.

Reviewed-by: David Herrmann &lt;dh.herrmann@gmail.com&gt;
Signed-off-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hidp: Add a comment that some devices depend on the current behavior of uniq</title>
<updated>2014-02-24T16:38:46Z</updated>
<author>
<name>Frank Praznik</name>
</author>
<published>2014-02-20T16:36:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dccf2f65e68d2f5b5e86ae6cf9796cf558694953'/>
<id>urn:sha1:dccf2f65e68d2f5b5e86ae6cf9796cf558694953</id>
<content type='text'>
Add a comment noting that some devices depend on the destination address being
stored in uniq.

Signed-off-by: Frank Praznik &lt;frank.praznik@oh.rr.com&gt;
Reviewed-by: David Herrmann &lt;dh.herrmann@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: Bluetooth: hidp: make sure input buffers are big enough</title>
<updated>2014-02-17T20:17:55Z</updated>
<author>
<name>David Herrmann</name>
</author>
<published>2013-12-19T11:09:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a4b1b5877b514b276f0f31efe02388a9c2836728'/>
<id>urn:sha1:a4b1b5877b514b276f0f31efe02388a9c2836728</id>
<content type='text'>
HID core expects the input buffers to be at least of size 4096
(HID_MAX_BUFFER_SIZE). Other sizes will result in buffer-overflows if an
input-report is smaller than advertised. We could, like i2c, compute the
biggest report-size instead of using HID_MAX_BUFFER_SIZE, but this will
blow up if report-descriptors are changed after -&gt;start() has been called.
So lets be safe and just use the biggest buffer we have.

Note that this adds an additional copy to the HIDP input path. If there is
a way to make sure the skb-buf is big enough, we should use that instead.

The best way would be to make hid-core honor the @size argument, though,
that sounds easier than it is. So lets just fix the buffer-overflows for
now and afterwards look for a faster way for all transport drivers.

Signed-off-by: David Herrmann &lt;dh.herrmann@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
</feed>
