linux/drivers/net
Gerhard Engleder 6bb50965e3 tsnep: Fix tsnep_request_irq() format-overflow warning
[ Upstream commit 00e984cb98 ]

Compiler warns about a possible format-overflow in tsnep_request_irq():
drivers/net/ethernet/engleder/tsnep_main.c:884:55: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
                         sprintf(queue->name, "%s-rx-%d", name,
                                                       ^
drivers/net/ethernet/engleder/tsnep_main.c:881:55: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
                         sprintf(queue->name, "%s-tx-%d", name,
                                                       ^
drivers/net/ethernet/engleder/tsnep_main.c:878:49: warning: '-txrx-' directive writing 6 bytes into a region of size between 5 and 25 [-Wformat-overflow=]
                         sprintf(queue->name, "%s-txrx-%d", name,
                                                 ^~~~~~

Actually overflow cannot happen. Name is limited to IFNAMSIZ, because
netdev_name() is called during ndo_open(). queue_index is single char,
because less than 10 queues are supported.

Fix warning with snprintf(). Additionally increase buffer to 32 bytes,
because those 7 additional bytes were unused anyway.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202310182028.vmDthIUa-lkp@intel.com/
Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20231023183856.58373-1-gerhard@engleder-embedded.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-28 17:19:38 +00:00
..
appletalk
arcnet net: arcnet: Do not call kfree_skb() under local_irq_disable() 2023-08-25 10:10:52 +01:00
bonding bonding: Return pointer to data after pull on skb 2023-10-13 11:21:13 +01:00
caif tty: use u8 for flags 2023-08-11 21:12:45 +02:00
can can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is accessed out of bounds 2023-11-20 11:59:00 +01:00
dsa net: dsa: bcm_sf2: Fix possible memory leak in bcm_sf2_mdio_register() 2023-10-13 16:29:46 -07:00
ethernet tsnep: Fix tsnep_request_irq() format-overflow warning 2023-11-28 17:19:38 +00:00
fddi
fjes
hamradio tty: use u8 for flags 2023-08-11 21:12:45 +02:00
hippi
hyperv
ieee802154 net: ieee802154: adf7242: Fix some potential buffer overflow in adf7242_stats_show() 2023-10-22 11:28:43 +01:00
ipa ARM: SoC drivers for 6.6 2023-08-30 16:42:21 -07:00
ipvlan ipvlan: properly track tx_errors 2023-11-20 11:59:04 +01:00
mctp tty: use u8 for flags 2023-08-11 21:12:45 +02:00
mdio net: mdio-mux: fix C45 access returning -EIO after API change 2023-10-18 18:08:23 -07:00
netdevsim net: netdevsim: mimic tc-taprio offload 2023-08-09 15:59:21 -07:00
pcs net: pcs: xpcs: adapt Wangxun NICs for SGMII mode 2023-08-25 07:42:59 +01:00
phy net: sfp: add quirk for FS's 2.5G copper SFP 2023-11-28 17:19:38 +00:00
plip
ppp TTY/Serial driver changes for 6.6-rc1 2023-09-01 09:38:00 -07:00
pse-pd
slip tty: use u8 for flags 2023-08-11 21:12:45 +02:00
team team: fix null-ptr-deref when team device type is changed 2023-09-19 16:28:37 +02:00
thunderbolt net: thunderbolt: Fix TCPv6 GSO checksum calculation 2023-09-15 13:45:05 +01:00
usb r8152: break the loop when the budget is exhausted 2023-11-20 11:59:00 +01:00
vmxnet3 vmxnet3: Add XDP support. 2023-08-14 08:03:52 +01:00
vxlan vxlan: Add missing entries to vxlan_get_size() 2023-09-20 09:00:54 +01:00
wan drivers/net: process the result of hdlc_open() and add call of hdlc_close() in uhdlc_close() 2023-09-22 08:19:18 +01:00
wireguard genetlink: use attrs from struct genl_info 2023-08-15 15:00:45 -07:00
wireless wifi: iwlwifi: mvm: fix size check for fw_link_id 2023-11-28 17:19:38 +00:00
wwan Revert "net: wwan: iosm: enable runtime pm support for 7560" 2023-10-18 11:08:52 +01:00
xen-netback xen-netback: use default TX queue size for vifs 2023-10-08 13:53:10 +01:00
amt.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c udp: annotate data-races around udp->encap_type 2023-11-20 11:58:56 +01:00
ifb.c
Kconfig netconsole: Enable compile time configuration 2023-08-17 19:25:42 -07:00
LICENSE.SRC
loopback.c
macsec.c net: add DEV_STATS_READ() helper 2023-11-20 11:59:04 +01:00
macvlan.c
macvtap.c
Makefile
mdio.c
mhi_net.c net: mhi: Remove redundant initialization owner in mhi_net_driver 2023-08-10 17:29:42 -07:00
mii.c
net_failover.c
netconsole.c netconsole: Enable compile time configuration 2023-08-17 19:25:42 -07:00
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
tun.c tun: prevent negative ifindex 2023-10-17 17:44:51 -07:00
veth.c veth: Update XDP feature set when bringing up device 2023-09-12 16:32:56 +02:00
virtio_net.c virtio_net: use u64_stats_t infra to avoid data-races 2023-11-20 11:59:03 +01:00
vrf.c sysctl-6.6-rc1 2023-08-29 17:39:15 -07:00
vsockmon.c
xen-netfront.c page_pool: split types and declarations from page_pool.h 2023-08-07 13:05:19 -07:00