linux-stable/drivers/staging
Larry Finger fcdf84a1dd staging: r8188eu: Fix warning of array overflow in ioctl_linux.c
[ Upstream commit 96f0a54e8e ]

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->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 2b42bd58b3 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver")

Fixes: 2b42bd58b3 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver")
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Phillip Potter <phil@philpotter.co.uk>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220531013103.2175-3-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-22 14:27:57 +02:00
..
axis-fifo staging: axis-fifo: Use platform_get_irq() to get the interrupt 2021-12-30 11:54:56 +01:00
board
clocking-wizard
emxx_udc
fbtft Staging driver update for 5.18-rc1 2022-03-28 12:50:50 -07:00
fieldbus staging: fieldbus: Fix the error handling path in anybuss_host_common_probe() 2022-06-14 18:44:46 +02:00
fwserial
gdm724x Staging driver update for 5.18-rc1 2022-03-28 12:50:50 -07:00
greybus staging: greybus: codecs: fix type confusion of list iterator variable 2022-06-14 18:44:44 +02:00
iio iio:adc:ad7280a: Move out of staging 2022-02-21 19:33:05 +00:00
ks7010 staging/ks7010: Remove redundant 'flush_workqueue()' calls 2022-02-15 17:05:43 +01:00
media media: rkvdec: h264: Fix bit depth wrap in pps packet 2022-06-09 10:30:15 +02:00
most Staging driver update for 5.18-rc1 2022-03-28 12:50:50 -07:00
nvec Staging: nvec: Fix ending in '(' error 2022-02-08 10:46:01 +01:00
octeon
octeon-usb
olpc_dcon
pi433 Staging driver update for 5.18-rc1 2022-03-28 12:50:50 -07:00
qlge staging: qlge: add unregister_netdev in qlge_probe 2022-02-21 18:07:23 +01:00
r8188eu staging: r8188eu: Fix warning of array overflow in ioctl_linux.c 2022-06-22 14:27:57 +02:00
rtl8192e drivers: staging: rtl8192e: Fix deadlock in rtllib_beacons_stop() 2022-06-14 18:45:09 +02:00
rtl8192u drivers: staging: rtl8192u: Fix deadlock in ieee80211_beacons_stop() 2022-06-14 18:45:09 +02:00
rtl8712 staging: rtl8712: fix uninit-value in r871xu_drv_init() 2022-06-14 18:45:11 +02:00
rtl8723bs drivers: staging: rtl8192bs: Fix deadlock in rtw_joinbss_event_prehandle() 2022-06-14 18:45:09 +02:00
rts5208 staging: rts5208: Resolve checkpatch.pl issues. 2022-03-18 13:44:02 +01:00
sm750fb staging: sm750fb: fix naming style 2022-03-18 13:43:41 +01:00
unisys Staging: unisys: visorhba: alignment should match open parenthesis 2022-02-08 10:34:53 +01:00
vc04_services Staging driver update for 5.18-rc1 2022-03-28 12:50:50 -07:00
vme
vt6655 staging: vt6655: Remove unused byRFType in card.c 2022-03-14 18:32:39 +01:00
vt6656 staging: vt6656: Removed unused variable vt3342_vnt_threshold 2022-03-15 15:17:09 +01:00
wfx Staging driver update for 5.18-rc1 2022-03-28 12:50:50 -07:00
wlan-ng staging: Use netif_rx(). 2022-03-07 11:40:40 +00:00
Kconfig mips: dts: ralink: add MT7621 SoC 2022-03-16 15:10:23 +01:00
Makefile mips: dts: ralink: add MT7621 SoC 2022-03-16 15:10:23 +01:00