1
linux/drivers
Paolo Abeni b49991d83b wifi: ath12k: fix build vs old compiler
gcc 11.4.1-3 warns about memcpy() with overlapping pointers:

drivers/net/wireless/ath/ath12k/wow.c: In function ‘ath12k_wow_convert_8023_to_80211.constprop’:
./include/linux/fortify-string.h:114:33: error: ‘__builtin_memcpy’ accessing 18446744073709551611 or more bytes at offsets 0 and 0 overlaps 9223372036854775799 bytes at offset -9223372036854775804 [-Werror=restrict]
  114 | #define __underlying_memcpy     __builtin_memcpy
      |                                 ^
./include/linux/fortify-string.h:637:9: note: in expansion of macro ‘__underlying_memcpy’
  637 |         __underlying_##op(p, q, __fortify_size);                        \
      |         ^~~~~~~~~~~~~
./include/linux/fortify-string.h:682:26: note: in expansion of macro ‘__fortify_memcpy_chk’
  682 | #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
      |                          ^~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath12k/wow.c:190:25: note: in expansion of macro ‘memcpy’
  190 |                         memcpy(pat, eth_pat, eth_pat_len);
      |                         ^~~~~~
./include/linux/fortify-string.h:114:33: error: ‘__builtin_memcpy’ accessing 18446744073709551605 or more bytes at offsets 0 and 0 overlaps 9223372036854775787 bytes at offset -9223372036854775798 [-Werror=restrict]
  114 | #define __underlying_memcpy     __builtin_memcpy
      |                                 ^
./include/linux/fortify-string.h:637:9: note: in expansion of macro ‘__underlying_memcpy’
  637 |         __underlying_##op(p, q, __fortify_size);                        \
      |         ^~~~~~~~~~~~~
./include/linux/fortify-string.h:682:26: note: in expansion of macro ‘__fortify_memcpy_chk’
  682 | #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
      |                          ^~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath12k/wow.c:232:25: note: in expansion of macro ‘memcpy’
  232 |                         memcpy(pat, eth_pat, eth_pat_len);
      |                         ^~~~~~

The sum of size_t operands can overflow SIZE_MAX, triggering the
warning.
Address the issue using the suitable helper.

Fixes: 4a3c212eee ("wifi: ath12k: add basic WoW functionalities")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Kees Cook <kees@kernel.org>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://patch.msgid.link/3175f87d7227e395b330fd88fb840c1645084ea7.1721127979.git.pabeni@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-07-16 07:51:05 -07:00
..
accel
accessibility
acpi ACPI: processor_idle: Fix invalid comparison with insertion sort for latency 2024-07-02 20:35:29 +02:00
amba
android
ata ata: ahci: Clean up sysfs file on error 2024-06-30 22:23:39 +02:00
atm
auxdisplay
base aux-sysfs-irqs 2024-07-15 12:42:45 -07:00
bcma
block
bluetooth Bluetooth: btmtk: Mark all stub functions as inline 2024-07-15 10:13:17 -04:00
bus
cache
cdrom
cdx
char Char/Misc driver fixes for 6.10-final 2024-07-12 08:45:27 -07:00
clk A set of clk fixes for the Qualcomm, Mediatek, and Allwinner drivers: 2024-07-07 10:59:38 -07:00
clocksource
comedi
connector
counter
cpufreq cpufreq: ACPI: Mark boost policy as enabled when setting boost 2024-07-01 18:10:52 +02:00
cpuidle
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-07-04 14:16:11 -07:00
cxl
dax
dca
devfreq
dio
dma Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-06-27 12:14:11 -07:00
dma-buf
dpll
edac
eisa
extcon
firewire
firmware sound fixes for 6.10-final 2024-07-12 08:32:40 -07:00
fpga
fsi
gnss
gpio gpiolib: of: add polarity quirk for TSC2005 2024-07-05 11:00:45 +02:00
gpu amd-drm-fixes-6.10-2024-07-03: 2024-07-05 12:54:14 +02:00
greybus
hid
hsi
hte
hv
hwmon
hwspinlock
hwtracing
i2c i2c: pnx: Fix potential deadlock warning from del_timer_sync() call in isr 2024-07-04 00:17:47 +02:00
i3c
idle
iio iio: light: apds9306: Fix error handing 2024-06-29 18:51:25 +01:00
infiniband aux-sysfs-irqs 2024-07-15 12:42:45 -07:00
input
interconnect
iommu iommu/amd: Fix GT feature enablement again 2024-06-27 12:14:19 +02:00
ipack
irqchip
isdn
leds
macintosh
mailbox
mcb
md - Fix broken discard for device mapper VDO target 2024-07-11 15:11:14 -07:00
media media fixes for v6.10-rc7 2024-07-03 10:10:45 -07:00
memory
memstick
message
mfd
misc mei: vsc: Fix spelling error 2024-07-04 12:21:39 +02:00
mmc mmc: davinci_mmc: Prevent transmitted data size from exceeding sgm's length 2024-07-11 17:48:54 +02:00
most
mtd
mux
net wifi: ath12k: fix build vs old compiler 2024-07-16 07:51:05 -07:00
nfc
ntb
nubus
nvdimm
nvme nvmet-fc: Remove __counted_by from nvmet_fc_tgt_queue.fod[] 2024-06-26 10:13:04 -07:00
nvmem nvmem: core: limit cell sysfs permissions to main attribute ones 2024-07-03 16:37:51 +02:00
of of/irq: Disable "interrupt-map" parsing for PASEMI Nemo 2024-07-08 15:42:20 -06:00
opp
parisc
parport
pci
pcmcia
peci
perf perf: RISC-V: Check standard event availability 2024-07-03 12:56:22 -07:00
phy
pinctrl
platform platform/x86: toshiba_acpi: Fix array out-of-bounds access 2024-07-10 16:12:12 +02:00
pmdomain pmdomain: qcom: rpmhpd: Skip retention level for Power Domains 2024-07-09 12:47:46 +02:00
pnp
power
powercap
pps
ps3
ptp net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390 net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
sbus
scsi SCSI fixes on 20240710 2024-07-10 14:47:35 -07:00
sh
siox
slimbus
soc soc: fsl: qbman: FSL_DPAA depends on COMPILE_TEST 2024-07-14 20:26:16 -07:00
soundwire
spi spi: mux: set ctlr->bits_per_word_mask 2024-07-09 17:42:33 +01:00
spmi
ssb
staging Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-07-04 14:16:11 -07:00
target
tc
tee Fix optee missing-field-initializers warning 2024-06-27 17:10:38 +02:00
thermal thermal: core: Fix list sorting in __thermal_zone_device_update() 2024-07-08 17:24:22 +02:00
thunderbolt
tty serial: qcom-geni: do not kill the machine on fifo underrun 2024-07-04 12:30:30 +02:00
ufs scsi: ufs: core: Fix ufshcd_abort_one racing issue 2024-07-04 23:04:15 -04:00
uio
usb USB-serial fixes for 6.10-rc8 2024-07-10 19:55:07 +02:00
vdpa
vfio vfio/pci: Init the count variable in collecting hot-reset devices 2024-07-10 08:47:46 -06:00
vhost
video
virt
virtio
w1
watchdog
xen
zorro
Kconfig
Makefile