<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/staging/r8188eu, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/staging/r8188eu?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/staging/r8188eu?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-06-06T06:10:14Z</updated>
<entry>
<title>staging: r8188eu: Fix warning of array overflow in ioctl_linux.c</title>
<updated>2022-06-06T06:10:14Z</updated>
<author>
<name>Larry Finger</name>
<email>Larry.Finger@lwfinger.net</email>
</author>
<published>2022-05-31T01:31:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=96f0a54e8e65a765b3a4ad4b53751581f23279f3'/>
<id>urn:sha1:96f0a54e8e65a765b3a4ad4b53751581f23279f3</id>
<content type='text'>
Building with -Warray-bounds results in the following warning plus others
related to the same problem:

CC [M]  drivers/staging/r8188eu/os_dep/ioctl_linux.o
In function ‘wpa_set_encryption’,
    inlined from ‘rtw_wx_set_enc_ext’ at drivers/staging/r8188eu/os_dep/ioctl_linux.c:1868:9:
drivers/staging/r8188eu/os_dep/ioctl_linux.c:412:41: warning: array subscript ‘struct ndis_802_11_wep[0]’ is partly outside array bounds of ‘void[25]’ [-Warray-bounds]
  412 |                         pwep-&gt;KeyLength = wep_key_len;
      |                         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from drivers/staging/r8188eu/os_dep/../include/osdep_service.h:19,
                 from drivers/staging/r8188eu/os_dep/ioctl_linux.c:4:
In function ‘kmalloc’,
    inlined from ‘kzalloc’ at ./include/linux/slab.h:733:9,
    inlined from ‘wpa_set_encryption’ at drivers/staging/r8188eu/os_dep/ioctl_linux.c:408:11,
    inlined from ‘rtw_wx_set_enc_ext’ at drivers/staging/r8188eu/os_dep/ioctl_linux.c:1868:9:
./include/linux/slab.h:605:16: note: object of size [17, 25] allocated by ‘__kmalloc’
  605 |         return __kmalloc(size, flags);
      |                ^~~~~~~~~~~~~~~~~~~~~~
./include/linux/slab.h:600:24: note: object of size [17, 25] allocated by ‘kmem_cache_alloc_trace’
  600 |                 return kmem_cache_alloc_trace(
      |                        ^~~~~~~~~~~~~~~~~~~~~~~
  601 |                                 kmalloc_caches[kmalloc_type(flags)][index],
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  602 |                                 flags, size);
      |                                 ~~~~~~~~~~~~

Although it is unlikely that anyone is still using WEP encryption, the
size of the allocation needs to be increased just in case.

Fixes commit 2b42bd58b321 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver")

Fixes: 2b42bd58b321 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver")
Signed-off-by: Larry Finger &lt;Larry.Finger@lwfinger.net&gt;
Cc: Phillip Potter &lt;phil@philpotter.co.uk&gt;
Cc: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Link: https://lore.kernel.org/r/20220531013103.2175-3-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: r8188eu: fix rtw_alloc_hwxmits error detection for now</title>
<updated>2022-06-06T06:09:21Z</updated>
<author>
<name>Phillip Potter</name>
<email>phil@philpotter.co.uk</email>
</author>
<published>2022-05-21T20:47:41Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=5b7419ae1d208cab1e2826d473d8dab045aa75c7'/>
<id>urn:sha1:5b7419ae1d208cab1e2826d473d8dab045aa75c7</id>
<content type='text'>
In _rtw_init_xmit_priv, we use the res variable to store the error
return from the newly converted rtw_alloc_hwxmits function. Sadly, the
calling function interprets res using _SUCCESS and _FAIL still, meaning
we change the semantics of the variable, even in the success case.

This leads to the following on boot:
r8188eu 1-2:1.0: _rtw_init_xmit_priv failed

In the long term, we should reverse these semantics, but for now, this
fixes the driver. Also, inside rtw_alloc_hwxmits remove the if blocks,
as HWXMIT_ENTRY is always 4.

Fixes: f94b47c6bde6 ("staging: r8188eu: add check for kzalloc")
Signed-off-by: Phillip Potter &lt;phil@philpotter.co.uk&gt;
Link: https://lore.kernel.org/r/20220521204741.921-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: r8188eu: remove include/rtw_debug.h</title>
<updated>2022-05-19T23:16:35Z</updated>
<author>
<name>Phillip Potter</name>
<email>phil@philpotter.co.uk</email>
</author>
<published>2022-05-19T22:10:47Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=6a31a95135da0bb2c5349e49e37d76e9909ab7ea'/>
<id>urn:sha1:6a31a95135da0bb2c5349e49e37d76e9909ab7ea</id>
<content type='text'>
Remove include/rtw_debug.h, as all it now has are:

(1) A load of unused preprocessor definitions that expand to BIT(x)
    variants.
(2) A preprocessor definition that expands to the name of the driver
    and is only used in one place inside a pr_info_once call in
    core/rtw_fw.c.

It is now surplus to requirements after fixing up the few places that
include the file.

Signed-off-by: Phillip Potter &lt;phil@philpotter.co.uk&gt;
Link: https://lore.kernel.org/r/20220519221047.6940-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: r8188eu: prevent -&gt;Ssid overflow in rtw_wx_set_scan()</title>
<updated>2022-05-19T17:35:47Z</updated>
<author>
<name>Denis Efremov</name>
<email>denis.e.efremov@oracle.com</email>
</author>
<published>2022-05-18T07:00:52Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=bc10916e890948d8927a5c8c40fb5dc44be5e1b8'/>
<id>urn:sha1:bc10916e890948d8927a5c8c40fb5dc44be5e1b8</id>
<content type='text'>
This code has a check to prevent read overflow but it needs another
check to prevent writing beyond the end of the -&gt;Ssid[] array.

Fixes: 2b42bd58b321 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver")
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Denis Efremov &lt;denis.e.efremov@oracle.com&gt;
Link: https://lore.kernel.org/r/20220518070052.108287-1-denis.e.efremov@oracle.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: r8188eu: delete rtw_wx_read/write32()</title>
<updated>2022-05-19T15:46:18Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2022-05-19T05:17:20Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=4d0cc9e0e53e9946d7b8dc58279c62dfa7a2191b'/>
<id>urn:sha1:4d0cc9e0e53e9946d7b8dc58279c62dfa7a2191b</id>
<content type='text'>
These debugging tools let you call:

	status = usb_control_msg_recv/send(udev, 0, REALTEK_USB_VENQT_CMD_REQ,
				      REALTEK_USB_VENQT_READ/WRITE, value,
				      REALTEK_USB_VENQT_CMD_IDX, io_buf,
				      size, RTW_USB_CONTROL_MSG_TIMEOUT,
				      GFP_KERNEL);

with a user controlled "value" in the 0-0xffff range.  It's not a valid
API.

Fixes: 2b42bd58b321 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Link: https://lore.kernel.org/r/YoXS4OaD1oauPvmj@kili
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: r8188eu: Remove multiple assignments</title>
<updated>2022-05-19T15:46:14Z</updated>
<author>
<name>Soumya Negi</name>
<email>soumya.negi97@gmail.com</email>
</author>
<published>2022-05-19T09:50:11Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=464725a95d8a1cc4bb8d28e2d55f2af3ff3368d5'/>
<id>urn:sha1:464725a95d8a1cc4bb8d28e2d55f2af3ff3368d5</id>
<content type='text'>
Conform to Linux coding style.
Issue found by checkpatch:-
CHECK: multiple assignments should be avoided

Signed-off-by: Soumya Negi &lt;soumya.negi97@gmail.com&gt;
Link: https://lore.kernel.org/r/20220519095012.5619-1-soumya.negi97@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: r8188eu: add check for kzalloc</title>
<updated>2022-05-19T15:45:56Z</updated>
<author>
<name>Jiasheng Jiang</name>
<email>jiasheng@iscas.ac.cn</email>
</author>
<published>2022-05-18T07:59:57Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f94b47c6bde624d6c07f43054087607c52054a95'/>
<id>urn:sha1:f94b47c6bde624d6c07f43054087607c52054a95</id>
<content type='text'>
As kzalloc() may return null pointer, it should be better to
check the return value and return error if fails in order
to avoid dereference of null pointer.
Moreover, the return value of rtw_alloc_hwxmits() should also
be dealt with.

Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Reviewed-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Jiasheng Jiang &lt;jiasheng@iscas.ac.cn&gt;
Link: https://lore.kernel.org/r/20220518075957.514603-1-jiasheng@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: r8188eu: fix warnings in rtw_wlan_util</title>
<updated>2022-05-19T15:44:43Z</updated>
<author>
<name>Vihas Makwana</name>
<email>makvihas@gmail.com</email>
</author>
<published>2022-05-17T14:06:26Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=455d5f02dc23f4e7a298b1f4acb5dc5457e08801'/>
<id>urn:sha1:455d5f02dc23f4e7a298b1f4acb5dc5457e08801</id>
<content type='text'>
Refactor the code to fix following warnings:
    WARNING: Comparisons should place the constant on the right side of the test
    CHECK: Comparison to NULL could be written "p"

Signed-off-by: Vihas Makwana &lt;makvihas@gmail.com&gt;
Link: https://lore.kernel.org/r/20220517140626.3716-4-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: r8188eu: fix warnings in rtw_pwrctrl</title>
<updated>2022-05-19T15:44:43Z</updated>
<author>
<name>Vihas Makwana</name>
<email>makvihas@gmail.com</email>
</author>
<published>2022-05-17T14:06:25Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=43ea9201795fb47dd48beaf64b3184bdfd481260'/>
<id>urn:sha1:43ea9201795fb47dd48beaf64b3184bdfd481260</id>
<content type='text'>
Refactor the code to fix following warnings:
    WARNING: Comparisons should place the constant on the right side of the test

Signed-off-by: Vihas Makwana &lt;makvihas@gmail.com&gt;
Link: https://lore.kernel.org/r/20220517140626.3716-3-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: r8188eu: fix warnings in rtw_p2p</title>
<updated>2022-05-19T15:44:43Z</updated>
<author>
<name>Vihas Makwana</name>
<email>makvihas@gmail.com</email>
</author>
<published>2022-05-17T14:06:24Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=801626f71d6f822e0becbfaa8b26a41addea693a'/>
<id>urn:sha1:801626f71d6f822e0becbfaa8b26a41addea693a</id>
<content type='text'>
Refactor the code to fix following warning:
    WARNING: Comparisons should place the constant on the right side of the test

Signed-off-by: Vihas Makwana &lt;makvihas@gmail.com&gt;
Link: https://lore.kernel.org/r/20220517140626.3716-2-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
