bianbu-linux-6.6/drivers/net/wireless/mediatek/mt76
Dmitry Antipov b521d90864 wifi: mt76: fix clang-specific fortify warnings
[ Upstream commit 03f0e11da7fb26db4f27e6b83a223512db9f7ca5 ]

When compiling with clang 16.0.6 and CONFIG_FORTIFY_SOURCE=y, I've
noticed the following (somewhat confusing due to absence of an actual
source code location):

In file included from drivers/net/wireless/mediatek/mt76/mt792x_core.c:4:
In file included from ./include/linux/module.h:13:
In file included from ./include/linux/stat.h:19:
In file included from ./include/linux/time.h:60:
In file included from ./include/linux/time32.h:13:
In file included from ./include/linux/timex.h:67:
In file included from ./arch/x86/include/asm/timex.h:5:
In file included from ./arch/x86/include/asm/processor.h:23:
In file included from ./arch/x86/include/asm/msr.h:11:
In file included from ./arch/x86/include/asm/cpumask.h:5:
In file included from ./include/linux/cpumask.h:12:
In file included from ./include/linux/bitmap.h:11:
In file included from ./include/linux/string.h:254:
./include/linux/fortify-string.h:592:4: warning: call to '__read_overflow2_field'
declared with 'warning' attribute: detected read beyond size of field (2nd
parameter); maybe use struct_group()? [-Wattribute-warning]
                        __read_overflow2_field(q_size_field, size);

In file included from drivers/net/wireless/mediatek/mt76/mt7915/main.c:4:
In file included from ./include/linux/etherdevice.h:20:
In file included from ./include/linux/if_ether.h:19:
In file included from ./include/linux/skbuff.h:15:
In file included from ./include/linux/time.h:60:
In file included from ./include/linux/time32.h:13:
In file included from ./include/linux/timex.h:67:
In file included from ./arch/x86/include/asm/timex.h:5:
In file included from ./arch/x86/include/asm/processor.h:23:
In file included from ./arch/x86/include/asm/msr.h:11:
In file included from ./arch/x86/include/asm/cpumask.h:5:
In file included from ./include/linux/cpumask.h:12:
In file included from ./include/linux/bitmap.h:11:
In file included from ./include/linux/string.h:254:
./include/linux/fortify-string.h:592:4: warning: call to '__read_overflow2_field'
declared with 'warning' attribute: detected read beyond size of field (2nd
parameter); maybe use struct_group()? [-Wattribute-warning]
                        __read_overflow2_field(q_size_field, size);

In file included from drivers/net/wireless/mediatek/mt76/mt7996/main.c:6:
In file included from drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h:9:
In file included from ./include/linux/interrupt.h:8:
In file included from ./include/linux/cpumask.h:12:
In file included from ./include/linux/bitmap.h:11:
In file included from ./include/linux/string.h:254:
./include/linux/fortify-string.h:592:4: warning: call to '__read_overflow2_field'
declared with 'warning' attribute: detected read beyond size of field (2nd
parameter); maybe use struct_group()? [-Wattribute-warning]
                        __read_overflow2_field(q_size_field, size);

The compiler actually complains on 'mt7915_get_et_strings()',
'mt792x_get_et_strings()' and 'mt7996_get_et_strings()' due to the same
reason: fortification logic inteprets call to 'memcpy()' as an attempt
to copy the whole array from its first member and so issues an overread
warning. These warnings may be silenced by passing an address of the whole
array and not the first member to 'memcpy()'.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-28 17:19:37 +00:00
..
mt76x0 Fix nomenclature for USB and PCI wireless devices 2023-08-25 12:56:49 +03:00
mt76x2 wifi: mt76: mt76x02: fix MT76x0 external LNA gain handling 2023-09-22 10:28:15 +03:00
mt7603 wifi: mt76: mt7603: improve stuck beacon handling 2023-11-20 11:58:58 +01:00
mt7615 wifi: mt76: fix per-band IEEE80211_CONF_MONITOR flag comparison 2023-11-20 11:58:58 +01:00
mt7915 wifi: mt76: fix clang-specific fortify warnings 2023-11-28 17:19:37 +00:00
mt7921 wifi: mt76: mt7921e: Support MT7992 IP in Xiaomi Redmibook 15 Pro (2023) 2023-11-28 17:19:37 +00:00
mt7996 wifi: mt76: fix clang-specific fortify warnings 2023-11-28 17:19:37 +00:00
agg-rx.c mt76: do not attempt to reorder received 802.3 packets without agg session 2022-05-13 09:39:35 +02:00
debugfs.c wifi: mt76: move leds struct in mt76_phy 2022-12-09 16:45:39 +01:00
dma.c wifi: mt76: remove unused error path in mt76_connac_tx_complete_skb 2023-11-20 11:58:58 +01:00
dma.h wifi: mt76: drop the incorrect scatter and gather frame 2023-04-17 15:34:34 +02:00
eeprom.c wifi: mt76: add support for providing eeprom in nvmem cells 2023-07-26 11:15:04 +02:00
Kconfig wifi: mt76: mt792x: introduce mt792x-usb module 2023-07-26 11:36:15 +02:00
mac80211.c wifi: mt76: mt7921: fix the wrong rate pickup for the chanctx driver 2023-11-20 11:58:59 +01:00
Makefile wifi: mt76: mt792x: introduce mt792x-usb module 2023-07-26 11:36:15 +02:00
mcu.c mt76: add len parameter to __mt76_mcu_msg_alloc signature 2022-07-11 13:40:03 +02:00
mmio.c mt76: mt7915: add Wireless Ethernet Dispatch support 2022-05-13 09:39:35 +02:00
mt76.h wifi: mt76: mt7921: fix the wrong rate pickup for the chanctx driver 2023-11-20 11:58:59 +01:00
mt76_connac.h wifi: mt76: connac: add connac3 mac library 2023-07-25 21:59:43 +02:00
mt76_connac2_mac.h wifi: mt76: mt7921e: report tx retries/failed counts in tx free event 2023-07-25 21:59:41 +02:00
mt76_connac3_mac.c wifi: mt76: connac: add connac3 mac library 2023-07-25 21:59:43 +02:00
mt76_connac3_mac.h wifi: mt76: mt7996: set correct wcid in txp 2023-11-20 11:58:58 +01:00
mt76_connac_mac.c wifi: mt76: mt7921: fix the wrong rate pickup for the chanctx driver 2023-11-20 11:58:59 +01:00
mt76_connac_mcu.c wifi: mt76: mt7921: fix the wrong rate selected in fw for the chanctx driver 2023-11-20 11:58:59 +01:00
mt76_connac_mcu.h wifi: mt76: mt7996: add muru support 2023-07-25 21:59:42 +02:00
mt76x02.h wifi: mt76: add info parameter to rx_skb signature 2022-12-01 17:29:14 +01:00
mt76x02_beacon.c mt76: mt76x02: improve reliability of the beacon hang check 2022-07-11 13:40:03 +02:00
mt76x02_debugfs.c wifi: mt76: move aggr_stats array in mt76_phy 2022-12-01 17:29:13 +01:00
mt76x02_dfs.c mt76: mt76x02: use mt76_phy_dfs_state to determine radar detector state 2022-02-03 16:15:05 +01:00
mt76x02_dfs.h
mt76x02_dma.h
mt76x02_eeprom.c wifi: mt76: mt76x02: fix MT76x0 external LNA gain handling 2023-09-22 10:28:15 +03:00
mt76x02_eeprom.h wifi: mt76: mt76x02: simplify struct mt76x02_rate_power 2022-12-01 17:29:12 +01:00
mt76x02_mac.c wifi: mt76: mt76x02: fix return value check in mt76x02_mac_process_rx 2023-07-31 10:56:17 +02:00
mt76x02_mac.h
mt76x02_mcu.c
mt76x02_mcu.h
mt76x02_mmio.c mt76: pass original queue id from __mt76_tx_queue_skb to the driver 2022-07-11 13:40:03 +02:00
mt76x02_phy.c wifi: mt76: mt76x02: simplify struct mt76x02_rate_power 2022-12-01 17:29:12 +01:00
mt76x02_phy.h wifi: mt76: move mt76_rate_power from core to mt76x02 driver code 2022-12-01 17:29:12 +01:00
mt76x02_regs.h mt76x02: improve mac error check/reset reliability 2022-02-03 14:34:35 +01:00
mt76x02_trace.c
mt76x02_trace.h wifi: mt76: Replace strlcpy() with strscpy() 2023-08-02 13:09:41 +03:00
mt76x02_txrx.c wifi: mt76: add info parameter to rx_skb signature 2022-12-01 17:29:14 +01:00
mt76x02_usb.h
mt76x02_usb_core.c
mt76x02_usb_mcu.c wifi: mt76: mt76_usb.mt76u_mcu.burst is always false remove related code 2022-09-15 12:54:00 +02:00
mt76x02_util.c wifi: mt76: ignore key disable commands 2023-04-03 16:50:20 +03:00
mt792x.h wifi: mt76: move struct ieee80211_chanctx_conf up to struct mt76_vif 2023-11-20 11:58:59 +01:00
mt792x_acpi_sar.c wifi: mt76: mt7921: move acpi_sar code in mt792x-lib module 2023-07-26 11:36:15 +02:00
mt792x_acpi_sar.h wifi: mt76: mt7921: move acpi_sar code in mt792x-lib module 2023-07-26 11:36:15 +02:00
mt792x_core.c wifi: mt76: fix clang-specific fortify warnings 2023-11-28 17:19:37 +00:00
mt792x_debugfs.c wifi: mt76: mt7921: move debugfs shared code in mt792x-lib module 2023-07-26 11:36:12 +02:00
mt792x_dma.c wifi: mt76: mt792x: move more dma shared code in mt792x_dma 2023-07-26 11:36:14 +02:00
mt792x_mac.c wifi: mt76: mt7921: move shared runtime-pm code on mt792x-lib 2023-07-26 11:36:14 +02:00
mt792x_regs.h wifi: mt76: mt792x: introduce mt792x_irq_map 2023-07-26 11:36:13 +02:00
mt792x_trace.c wifi: mt76: mt792x: introduce mt792x-lib module 2023-07-26 11:36:11 +02:00
mt792x_trace.h wifi: mt76: mt792x: introduce mt792x-lib module 2023-07-26 11:36:11 +02:00
mt792x_usb.c wifi: mt76: mt7921: move mt7921u_disconnect mt792x-lib 2023-07-26 11:36:17 +02:00
pci.c
sdio.c wifi: mt76: add memory barrier to SDIO queue kick 2023-02-03 14:47:17 +01:00
sdio.h mt76: mt7921s: fix mt7921s_mcu_[fw|drv]_pmctrl 2022-02-03 13:57:59 +01:00
sdio_txrx.c wifi: mt76: mt7921s: fix slab-out-of-bounds access in sdio host 2022-12-09 16:45:38 +01:00
testmode.c wifi: mt76: testmode: add nla_policy for MT76_TM_ATTR_TX_LENGTH 2023-07-26 13:09:46 +02:00
testmode.h wireless-drivers-next patches for v5.17 2021-12-23 09:12:37 -08:00
trace.c
trace.h wifi: mt76: Replace strlcpy() with strscpy() 2023-08-02 13:09:41 +03:00
tx.c wifi: mt76: report non-binding skb tx rate when WED is active 2023-07-25 21:59:40 +02:00
usb.c USB: Remove remnants of Wireless USB and UWB 2023-08-09 14:17:06 +02:00
usb_trace.c
usb_trace.h wifi: mt76: Replace strlcpy() with strscpy() 2023-08-02 13:09:41 +03:00
util.c wifi: mt76: add flexible polling wait-interval support 2023-02-03 14:47:17 +01:00
util.h wifi: mt76: Remove unused inline function mt76_wcid_mask_test() 2022-12-01 17:29:12 +01:00