OrangePi_CM5/drivers/staging
Kees Cook 2a69325ee5 staging: rts5208: Fix get_ms_information() heap buffer size
[ Upstream commit cbe34165cc1b7d1110b268ba8b9f30843c941639 ]

Fix buf allocation size (it needs to be 2 bytes larger). Found when
__alloc_size() annotations were added to kmalloc() interfaces.

In file included from ./include/linux/string.h:253,
                 from ./include/linux/bitmap.h:10,
                 from ./include/linux/cpumask.h:12,
                 from ./arch/x86/include/asm/paravirt.h:17,
                 from ./arch/x86/include/asm/irqflags.h:63,
                 from ./include/linux/irqflags.h:16,
                 from ./include/linux/rcupdate.h:26,
                 from ./include/linux/rculist.h:11,
                 from ./include/linux/pid.h:5,
                 from ./include/linux/sched.h:14,
                 from ./include/linux/blkdev.h:5,
                 from drivers/staging/rts5208/rtsx_scsi.c:12:
In function 'get_ms_information',
    inlined from 'ms_sp_cmnd' at drivers/staging/rts5208/rtsx_scsi.c:2877:12,
    inlined from 'rtsx_scsi_handler' at drivers/staging/rts5208/rtsx_scsi.c:3247:12:
./include/linux/fortify-string.h:54:29: warning: '__builtin_memcpy' forming offset [106, 107] is out
 of the bounds [0, 106] [-Warray-bounds]
   54 | #define __underlying_memcpy __builtin_memcpy
      |                             ^
./include/linux/fortify-string.h:417:2: note: in expansion of macro '__underlying_memcpy'
  417 |  __underlying_##op(p, q, __fortify_size);   \
      |  ^~~~~~~~~~~~~
./include/linux/fortify-string.h:463:26: note: in expansion of macro '__fortify_memcpy_chk'
  463 | #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,   \
      |                          ^~~~~~~~~~~~~~~~~~~~
drivers/staging/rts5208/rtsx_scsi.c:2851:3: note: in expansion of macro 'memcpy'
 2851 |   memcpy(buf + i, ms_card->raw_sys_info, 96);
      |   ^~~~~~

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210818044252.1533634-1-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-18 13:40:30 +02:00
..
android
…
axis-fifo
…
board staging: board: Fix uninitialized spinlock when attaching genpd 2021-09-18 13:40:20 +02:00
clocking-wizard clk: staging: correct reference to config IOMEM to config HAS_IOMEM 2021-09-15 09:50:41 +02:00
comedi
…
emxx_udc
…
fbtft staging: fbtft: Don't spam logs when probe is deferred 2021-07-14 16:56:32 +02:00
fieldbus
…
fsl-dpaa2
…
fwserial
…
gasket
…
gdm724x staging: gdm724x: check for overflow in gdm_lte_netif_rx() 2021-07-14 16:56:45 +02:00
goldfish
…
greybus
…
gs_fpgaboot
…
hikey9xx
…
iio
…
kpc2000
…
ks7010 staging: ks7010: Fix the initialization of the 'sleep_status' structure 2021-09-18 13:40:23 +02:00
media media: atomisp: pci: fix error return code in atomisp_pci_probe() 2021-09-18 13:40:20 +02:00
most
…
mt7621-dma
…
mt7621-dts staging: mt7621-dts: fix pci address for PCI memory range 2021-07-14 16:56:46 +02:00
mt7621-pci
…
mt7621-pci-phy
…
mt7621-pinctrl
…
netlogic
…
nvec
…
octeon
…
octeon-usb
…
olpc_dcon
…
pi433
…
qlge
…
ralink-gdma
…
rtl8188eu
…
rtl8192e
…
rtl8192u
…
rtl8712 staging: rtl8712: error handling refactoring 2021-08-12 13:22:14 +02:00
rtl8723bs staging: rtl8723bs: Fix a resource leak in sd_int_dpc 2021-08-12 13:22:13 +02:00
rts5208 staging: rts5208: Fix get_ms_information() heap buffer size 2021-09-18 13:40:30 +02:00
sm750fb
…
unisys
…
vc04_services staging: mmal-vchiq: Fix incorrect static vchiq_instance. 2021-07-14 16:56:39 +02:00
vme
…
vt6655
…
vt6656
…
wfx
…
wlan-ng
…
Kconfig
…
Makefile
…