mirror-linux/drivers/net
Gerhard Engleder c90c7bf7b1 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:06:56 +00:00
..
appletalk
arcnet net: arcnet: Do not call kfree_skb() under local_irq_disable() 2023-09-13 09:42:35 +02:00
bonding bonding: Return pointer to data after pull on skb 2023-10-25 12:03:07 +02:00
caif
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:51:53 +01:00
dsa net: dsa: bcm_sf2: Fix possible memory leak in bcm_sf2_mdio_register() 2023-10-25 12:03:07 +02:00
ethernet tsnep: Fix tsnep_request_irq() format-overflow warning 2023-11-28 17:06:56 +00:00
fddi
fjes
hamradio
hippi
hyperv
ieee802154 net: ieee802154: adf7242: Fix some potential buffer overflow in adf7242_stats_show() 2023-11-02 09:35:27 +01:00
ipa
ipvlan ipvlan: properly track tx_errors 2023-11-20 11:51:55 +01:00
mctp
mdio
netdevsim
pcs net: pcs: Add missing put_device call in miic_create 2023-08-23 17:52:33 +02:00
phy net: phy: bcm7xxx: Add missing 16nm EPHY statistics 2023-10-25 12:03:08 +02:00
plip
ppp
pse-pd
slip
team team: fix null-ptr-deref when team device type is changed 2023-10-06 14:56:41 +02:00
usb r8152: Check for unplug in r8153b_ups_en() / r8153c_ups_en() 2023-11-08 14:11:02 +01:00
vmxnet3
vxlan neighbour: annotate lockless accesses to n->nud_state 2023-10-10 22:00:42 +02:00
wan drivers/net: process the result of hdlc_open() and add call of hdlc_close() in uhdlc_close() 2023-10-10 22:00:40 +02:00
wireguard wireguard: allowedips: expand maximum node depth 2023-08-16 18:27:20 +02:00
wireless wifi: ath10k: Don't touch the CE interrupt registers after power up 2023-11-28 17:06:56 +00:00
wwan
xen-netback xen-netback: use default TX queue size for vifs 2023-10-19 23:08:53 +02:00
Kconfig
LICENSE.SRC
Makefile
Space.c
amt.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c gtp: fix fragmentation needed check with gso 2023-11-02 09:35:28 +01:00
ifb.c
loopback.c
macsec.c net: add DEV_STATS_READ() helper 2023-11-20 11:51:55 +01:00
macvlan.c
macvtap.c
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c
thunderbolt.c net: thunderbolt: Fix TCPv6 GSO checksum calculation 2023-10-06 14:57:04 +02:00
tun.c tun: prevent negative ifindex 2023-10-25 12:03:06 +02:00
veth.c veth: Fixing transmit return status for dropped packets 2023-09-19 12:28:02 +02:00
virtio_net.c virtio-net: Zero max_tx_vq field for VIRTIO_NET_CTRL_MQ_HASH_CONFIG case 2023-08-23 17:52:39 +02:00
vrf.c vrf: Fix lockdep splat in output path 2023-10-10 22:00:46 +02:00
vsockmon.c
xen-netfront.c