<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pm24.git/drivers/net/wireless/rsi/rsi_usb.h, branch rust-6.8</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>https://git.kobert.dev/pm24.git/atom/drivers/net/wireless/rsi/rsi_usb.h?h=rust-6.8</id>
<link rel='self' href='https://git.kobert.dev/pm24.git/atom/drivers/net/wireless/rsi/rsi_usb.h?h=rust-6.8'/>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/'/>
<updated>2021-11-29T10:43:54Z</updated>
<entry>
<title>rsi: Fix out-of-bounds read in rsi_read_pkt()</title>
<updated>2021-11-29T10:43:54Z</updated>
<author>
<name>Zekun Shen</name>
<email>bruceshenzk@gmail.com</email>
</author>
<published>2021-10-29T20:19:23Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=f1cb3476e48b60c450ec3a1d7da0805bffc6e43a'/>
<id>urn:sha1:f1cb3476e48b60c450ec3a1d7da0805bffc6e43a</id>
<content type='text'>
rsi_get_* functions rely on an offset variable from usb
input. The size of usb input is RSI_MAX_RX_USB_PKT_SIZE(3000),
while 2-byte offset can be up to 0xFFFF. Thus a large offset
can cause out-of-bounds read.

The patch adds a bound checking condition when rcv_pkt_len is 0,
indicating it's USB. It's unclear whether this is triggerable
from other type of bus. The following check might help in that case.
offset &gt; rcv_pkt_len - FRAME_DESC_SZ

The bug is trigerrable with conpromised/malfunctioning USB devices.
I tested the patch with the crashing input and got no more bug report.

Attached is the KASAN report from fuzzing.

BUG: KASAN: slab-out-of-bounds in rsi_read_pkt+0x42e/0x500 [rsi_91x]
Read of size 2 at addr ffff888019439fdb by task RX-Thread/227

CPU: 0 PID: 227 Comm: RX-Thread Not tainted 5.6.0 #66
Call Trace:
 dump_stack+0x76/0xa0
 print_address_description.constprop.0+0x16/0x200
 ? rsi_read_pkt+0x42e/0x500 [rsi_91x]
 ? rsi_read_pkt+0x42e/0x500 [rsi_91x]
 __kasan_report.cold+0x37/0x7c
 ? rsi_read_pkt+0x42e/0x500 [rsi_91x]
 kasan_report+0xe/0x20
 rsi_read_pkt+0x42e/0x500 [rsi_91x]
 rsi_usb_rx_thread+0x1b1/0x2fc [rsi_usb]
 ? rsi_probe+0x16a0/0x16a0 [rsi_usb]
 ? _raw_spin_lock_irqsave+0x7b/0xd0
 ? _raw_spin_trylock_bh+0x120/0x120
 ? __wake_up_common+0x10b/0x520
 ? rsi_probe+0x16a0/0x16a0 [rsi_usb]
 kthread+0x2b5/0x3b0
 ? kthread_create_on_node+0xd0/0xd0
 ret_from_fork+0x22/0x40

Reported-by: Brendan Dolan-Gavitt &lt;brendandg@nyu.edu&gt;
Signed-off-by: Zekun Shen &lt;bruceshenzk@gmail.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/YXxXS4wgu2OsmlVv@10-18-43-117.dynapool.wireless.nyu.edu
</content>
</entry>
<entry>
<title>rsi: fix comment syntax in file headers</title>
<updated>2021-04-18T06:27:35Z</updated>
<author>
<name>Aditya Srivastava</name>
<email>yashsri421@gmail.com</email>
</author>
<published>2021-03-15T17:32:59Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=3051946056c3b634605b275a223e48bcb796f49b'/>
<id>urn:sha1:3051946056c3b634605b275a223e48bcb796f49b</id>
<content type='text'>
The opening comment mark '/**' is used for highlighting the beginning of
kernel-doc comments.
There are some files in drivers/net/wireless/rsi which follow this syntax
in their file headers, i.e. start with '/**' like comments, which causes
unexpected warnings from kernel-doc.

E.g., running scripts/kernel-doc -none on drivers/net/wireless/rsi/rsi_coex.h
causes this warning:
"warning: wrong kernel-doc identifier on line:
 * Copyright (c) 2018 Redpine Signals Inc."

Similarly for other files too.

Provide a simple fix by replacing such occurrences with general comment
format, i.e., "/*", to prevent kernel-doc from parsing it.

Signed-off-by: Aditya Srivastava &lt;yashsri421@gmail.com&gt;
Reviewed-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20210315173259.8757-1-yashsri421@gmail.com
</content>
</entry>
<entry>
<title>rsi: add new device model for 9116</title>
<updated>2019-04-25T16:44:23Z</updated>
<author>
<name>Siva Rebbagondla</name>
<email>siva8118@gmail.com</email>
</author>
<published>2019-04-03T04:13:02Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=54fdb318c1116814711fad4bd166e6c85a477ef0'/>
<id>urn:sha1:54fdb318c1116814711fad4bd166e6c85a477ef0</id>
<content type='text'>
9116 device id entry is added in both SDIO and USB interfaces.
New enumberation value taken for the device model. Based on the
device model detected run time, few device specific operations
needs to be performed.

adding rsi_dev_model to get device type in run time, as we can use
same driver for 9113 and 9116 except few firmware load changes.

Signed-off-by: Siva Rebbagondla &lt;siva8118@gmail.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>rsi: remove redundant device ids</title>
<updated>2018-07-31T07:15:53Z</updated>
<author>
<name>Siva Rebbagondla</name>
<email>siva.rebbagondla@redpinesignals.com</email>
</author>
<published>2018-07-16T13:39:32Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=5850874c28a477046e78f7336a47faaf9b5db11d'/>
<id>urn:sha1:5850874c28a477046e78f7336a47faaf9b5db11d</id>
<content type='text'>
Removing redundant device id's from both usb and sdio idtables, as rsi
driver currently supporting only one module(RS9113). Also, replaced ids
with specific defines.

Signed-off-by: Siva Rebbagondla &lt;siva.rebbagondla@redpinesignals.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>rsi: disable fw watchdog timer during reset</title>
<updated>2018-04-24T17:25:01Z</updated>
<author>
<name>Amitkumar Karwar</name>
<email>amit.karwar@redpinesignals.com</email>
</author>
<published>2018-04-10T15:04:11Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=16d3bb7b2f37b917b3c55e83d230a199f5c51864'/>
<id>urn:sha1:16d3bb7b2f37b917b3c55e83d230a199f5c51864</id>
<content type='text'>
Firmware's watchdog timer should be disabled as a part of reset
sequence. This change fixes a firmware hang issue observed during
stress tests.

Signed-off-by: Amitkumar Karwar &lt;amit.karwar@redpinesignals.com&gt;
Signed-off-by: Siva Rebbagondla &lt;siva.rebbagondla@redpinesignals.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>rsi: improve RX packet handling in USB interface</title>
<updated>2018-03-13T16:42:26Z</updated>
<author>
<name>Prameela Rani Garnepudi</name>
<email>prameela.j04cs@gmail.com</email>
</author>
<published>2018-02-28T07:38:28Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=a1854fae1414dd8edfff4857fd26c3e355d43e19'/>
<id>urn:sha1:a1854fae1414dd8edfff4857fd26c3e355d43e19</id>
<content type='text'>
Curretly, RX packet processing is done sequencially. To improve
the efficiency, RX skb queue is introduced.
Here, while preparing RX URB skb is allocated and used
for RX buffer. When rx done handler is called, enqueue the skb
to rx_q and set the thread event.
RX thread is modified to dequeue packets from skb queue and
process further.

Signed-off-by: Prameela Rani Garnepudi &lt;prameela.j04cs@gmail.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>rsi: add bluetooth rx endpoint</title>
<updated>2018-03-13T16:36:55Z</updated>
<author>
<name>Siva Rebbagondla</name>
<email>siva.rebbagondla@redpinesignals.com</email>
</author>
<published>2018-02-27T14:26:12Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=a4302bff28e2f35ea2471804978c7a601aa05999'/>
<id>urn:sha1:a4302bff28e2f35ea2471804978c7a601aa05999</id>
<content type='text'>
USB endpoint 1 is used for WLAN which is presently in use.
USB endpoint 2 is introduced for BT Rx traffic. Enumeration
of Rx BT endpoint and submitting Rx BT URB are added.

&gt;From /sys/kernel/debug/usb/devices,
Ad=81(I) is for WLAN EP IN and Ad=01(O) is for Wlan EP OUT.
Ad=82(I) is for BT EP IN and Ad=02(O) is for BT EP OUT.

T:  Bus=01 Lev=01 Prnt=01 Port=09 Cnt=03 Dev#=  4 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=00(&gt;ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1618 ProdID=9113 Rev= 0.02
S:  Manufacturer=Redpine Signals, Inc.
S:  Product=Wireless USB Network Module
S:  SerialNumber=000000000001
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  2mA
I:* If#= 0 Alt= 0 #EPs= 6 Cls=00(&gt;ifc ) Sub=00 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

Signed-off-by: Siva Rebbagondla &lt;siva.rebbagondla@redpinesignals.com&gt;
Signed-off-by: Prameela Rani Garnepudi &lt;prameela.j04cs@gmail.com&gt;
Signed-off-by: Amitkumar Karwar &lt;amit.karwar@redpinesignals.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>rsi: add rx control block to handle rx packets in USB</title>
<updated>2018-03-13T16:36:54Z</updated>
<author>
<name>Prameela Rani Garnepudi</name>
<email>prameela.j04cs@gmail.com</email>
</author>
<published>2018-02-27T14:26:11Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=1100f81bbcd1ace918ce63fa3be1b854bca6baf2'/>
<id>urn:sha1:1100f81bbcd1ace918ce63fa3be1b854bca6baf2</id>
<content type='text'>
Rx bluetooth endpoint shall be added in further patches. Rx control
block is introduced here to handle Rx packets properly. Separate
function is written to initialize the RX control blocks.

Signed-off-by: Prameela Rani Garnepudi &lt;prameela.j04cs@gmail.com&gt;
Signed-off-by: Siva Rebbagondla &lt;siva.rebbagondla@redpinesignals.com&gt;
Signed-off-by: Amitkumar Karwar &lt;amit.karwar@redpinesignals.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>rsi: use macro for allocating USB buffer</title>
<updated>2017-07-28T14:27:18Z</updated>
<author>
<name>Amitkumar Karwar</name>
<email>amit.karwar@redpinesignals.com</email>
</author>
<published>2017-07-11T14:27:51Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=523b724a769b69963ef46efa14b8b730b40419d5'/>
<id>urn:sha1:523b724a769b69963ef46efa14b8b730b40419d5</id>
<content type='text'>
4 bytes is fixed size for reading or writing USB register. We
will use a macro instead of hardcoding this.

Fixes: b97e9b94ad75c ("rsi: Add new host interface operations")
Signed-off-by: Amitkumar Karwar &lt;amit.karwar@redpinesignals.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>rsi: rename USB endpoint macros</title>
<updated>2017-07-28T14:22:36Z</updated>
<author>
<name>Karun Eagalapati</name>
<email>karun256@gmail.com</email>
</author>
<published>2017-07-06T14:37:12Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=5d16a1c1ae1193fdc8379fc4fb0b49b8ff9386db'/>
<id>urn:sha1:5d16a1c1ae1193fdc8379fc4fb0b49b8ff9386db</id>
<content type='text'>
These endpoints are for WLAN and BT protocols.

Signed-off-by: Karun Eagalapati &lt;karun256@gmail.com&gt;
Signed-off-by: Amitkumar Karwar &lt;amit.karwar@redpinesignals.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
</content>
</entry>
</feed>
