linux/drivers/net
Camel Guo 7af037c39b net: stmmac: dump gmac4 DMA registers correctly
Unlike gmac100, gmac1000, gmac4 has 27 DMA registers and they are
located at DMA_CHAN_BASE_ADDR (0x1100). In order for ethtool to dump
gmac4 DMA registers correctly, this commit checks if a net_device has
gmac4 and uses different logic to dump its DMA registers.

This fixes the following KASAN warning, which can normally be triggered
by a command similar like "ethtool -d eth0":

BUG: KASAN: vmalloc-out-of-bounds in dwmac4_dump_dma_regs+0x6d4/0xb30
Write of size 4 at addr ffffffc010177100 by task ethtool/1839
 kasan_report+0x200/0x21c
 __asan_report_store4_noabort+0x34/0x60
 dwmac4_dump_dma_regs+0x6d4/0xb30
 stmmac_ethtool_gregs+0x110/0x204
 ethtool_get_regs+0x200/0x4b0
 dev_ethtool+0x1dac/0x3800
 dev_ioctl+0x7c0/0xb50
 sock_ioctl+0x298/0x6c4
 ...

Fixes: fbf68229ff ("net: stmmac: unify registers dumps methods")
Signed-off-by: Camel Guo <camelg@axis.com>
Link: https://lore.kernel.org/r/20220131083841.3346801-1-camel.guo@axis.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-01-31 21:21:10 -08:00
..
appletalk net: Don't include filter.h from net/sock.h 2021-12-29 08:48:14 -08:00
arcnet
bonding Networking fixes for 5.17-rc2, including fixes from netfilter and can. 2022-01-27 20:58:39 +02:00
caif virtio: wrap config->reset calls 2022-01-14 18:50:52 -05:00
can can: flexcan: mark RX via mailboxes as supported on MCF5441X 2022-01-24 18:27:43 +01:00
dsa net: dsa: mt7530: make NET_DSA_MT7530 select MEDIATEK_GE_PHY 2022-01-31 21:18:17 -08:00
ethernet net: stmmac: dump gmac4 DMA registers correctly 2022-01-31 21:21:10 -08:00
fddi net:Remove initialization of static variables to 0 2021-12-27 14:53:00 +00:00
fjes
hamradio yam: fix a memory leak in yam_siocdevprivate() 2022-01-25 11:04:55 +00:00
hippi
hyperv hyperv-next for 5.17 2022-01-16 15:53:00 +02:00
ieee802154 net: ieee802154: ca8210: Stop leaking skb's 2022-01-27 08:20:39 +01:00
ipa net: ipa: prevent concurrent replenish 2022-01-12 14:39:53 +00:00
ipvlan
mctp
mdio
netdevsim
pcs net: pcs: lynx: use a common naming scheme for all lynx_pcs variables 2022-01-02 18:48:47 +00:00
phy net: sfp: ignore disabled SFP node 2022-01-24 11:53:01 +00:00
plip
ppp TTY/Serial driver updates for 5.17-rc1 2022-01-12 11:21:52 -08:00
slip
team
usb net: usb: Correct reset handling of smsc95xx 2022-01-14 11:21:06 +00:00
vmxnet3 vmxnet3: Remove useless DMA-32 fallback configuration 2022-01-09 16:52:19 -08:00
wan net: wan/lmc: fix spelling of "its" 2021-12-24 10:23:47 +00:00
wireguard lib/crypto: blake2s: move hmac construction into wireguard 2022-01-18 13:03:55 +01:00
wireless proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
wwan net: wwan: Fix MRU mismatch issue which may lead to data connection lost 2022-01-15 22:40:52 +00:00
xen-netback
amt.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-01-09 17:00:17 -08:00
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
Kconfig lib/crypto: blake2s: include as built-in 2022-01-07 00:25:25 +01:00
LICENSE.SRC
loopback.c net: Don't include filter.h from net/sock.h 2021-12-29 08:48:14 -08:00
macsec.c
macvlan.c
macvtap.c
Makefile
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-31 14:35:40 +00:00
veth.c veth: Do not record rx queue hint in veth_xmit 2022-01-06 13:49:54 +00:00
virtio_net.c bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
vrf.c net: Don't include filter.h from net/sock.h 2021-12-29 08:48:14 -08:00
vsockmon.c
vxlan.c
xen-netfront.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-31 14:35:40 +00:00