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>
History 2023-11-28 17:19:38 +00:00
..
appletalk net: appletalk: remove Apple/Farallon LocalTalk PC support 2022-05-11 13:08:38 +01:00
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 net: fddi: skfp: rmt: Clean up some inconsistent indenting 2023-04-11 12:46:26 +02:00
fjes ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
hamradio tty: use u8 for flags 2023-08-11 21:12:45 +02:00
hippi net: hippi: Add missing pci_disable_device() in rr_init_one() 2022-09-26 13:22:39 -07:00
hyperv eth: add missing xdp.h includes in drivers 2023-08-03 08:38:07 -07:00
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 net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq() 2022-12-07 20:10:47 -08:00
ppp TTY/Serial driver changes for 6.6-rc1 2023-09-01 09:38:00 -07:00
pse-pd net: pse-pd: PSE_REGULATOR should depend on REGULATOR 2022-10-05 20:32:28 -07:00
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 amt: remove unnecessary skb pointer check 2022-08-19 16:51:21 -07:00
bareudp.c bareudp: use ipv6_mod_enabled to check if IPv6 enabled 2022-03-16 19:16:57 -07:00
dummy.c ethtool: doc: clarify what drivers can implement in their get_drvinfo() 2022-11-17 19:26:02 -08:00
eql.c net: rename reference+tracking helpers 2022-06-09 21:52:55 -07:00
geneve.c net: geneve: accept every ethertype 2023-03-21 13:39:29 +01:00
gtp.c udp: annotate data-races around udp->encap_type 2023-11-20 11:58:56 +01:00
ifb.c net: Remove the obsolte u64_stats_fetch_*_irq() users (drivers). 2022-10-28 20:13:54 -07:00
Kconfig netconsole: Enable compile time configuration 2023-08-17 19:25:42 -07:00
LICENSE.SRC Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
loopback.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-29 13:04:52 -08:00
macsec.c net: add DEV_STATS_READ() helper 2023-11-20 11:59:04 +01:00
macvlan.c net: macvlan: convert to ndo_hwtstamp_get() / ndo_hwtstamp_set() 2023-08-02 19:11:06 -07:00
macvtap.c drivers: remove struct module * setting from struct class 2023-03-17 15:16:27 +01:00
Makefile net: thunderbolt: Move into own directory 2023-01-12 21:19:30 -08:00
mdio.c net: mdio: Correct function name mdio45_links_ok() in comment 2021-03-29 13:42:44 -07:00
mhi_net.c net: mhi: Remove redundant initialization owner in mhi_net_driver 2023-08-10 17:29:42 -07:00
mii.c net: mii: make mii_ethtool_gset() return void 2021-08-19 13:06:53 +01:00
net_failover.c net/net_failover: fix txq exceeding warning 2023-03-27 08:08:57 +01:00
netconsole.c netconsole: Enable compile time configuration 2023-08-17 19:25:42 -07:00
nlmon.c net: don't include ethtool.h from netdevice.h 2020-11-23 17:27:04 -08:00
ntb_netdev.c ntb_netdev: Fix module_init problem 2023-07-08 11:03:53 -04:00
rionet.c driver core: class: remove struct class_interface * from callbacks 2023-04-03 21:42:52 +02:00
sb1000.c net: dev: Makes sure netif_rx() can be invoked in any context. 2022-02-14 13:38:35 +00:00
Space.c net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
sungem_phy.c net: sungem_phy: Add of_node_put() for reference returned by of_get_parent() 2022-07-21 19:04:19 -07:00
tap.c pull-request: bpf-next 2023-08-03 2023-08-03 15:34:36 -07:00
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 net: don't include ethtool.h from netdevice.h 2020-11-23 17:27:04 -08:00
xen-netfront.c page_pool: split types and declarations from page_pool.h 2023-08-07 13:05:19 -07:00