android_kernel_motorola_sm6375/drivers/net
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Piergiorgio Beruto df121012e4 stmmac: fix potential division by 0
[ Upstream commit ede5a389852d3640a28e7187fb32b7f204380901 ]

When the MAC is connected to a 10 Mb/s PHY and the PTP clock is derived
from the MAC reference clock (default), the clk_ptp_rate becomes too
small and the calculated sub second increment becomes 0 when computed by
the stmmac_config_sub_second_increment() function within
stmmac_init_tstamp_counter().

Therefore, the subsequent div_u64 in stmmac_init_tstamp_counter()
operation triggers a divide by 0 exception as shown below.

[   95.062067] socfpga-dwmac ff700000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
[   95.076440] socfpga-dwmac ff700000.ethernet eth0: PHY [stmmac-0:08] driver [NCN26000] (irq=49)
[   95.095964] dwmac1000: Master AXI performs any burst length
[   95.101588] socfpga-dwmac ff700000.ethernet eth0: No Safety Features support found
[   95.109428] Division by zero in kernel.
[   95.113447] CPU: 0 PID: 239 Comm: ifconfig Not tainted 6.1.0-rc7-centurion3-1.0.3.0-01574-gb624218205b7-dirty #77
[   95.123686] Hardware name: Altera SOCFPGA
[   95.127695]  unwind_backtrace from show_stack+0x10/0x14
[   95.132938]  show_stack from dump_stack_lvl+0x40/0x4c
[   95.137992]  dump_stack_lvl from Ldiv0+0x8/0x10
[   95.142527]  Ldiv0 from __aeabi_uidivmod+0x8/0x18
[   95.147232]  __aeabi_uidivmod from div_u64_rem+0x1c/0x40
[   95.152552]  div_u64_rem from stmmac_init_tstamp_counter+0xd0/0x164
[   95.158826]  stmmac_init_tstamp_counter from stmmac_hw_setup+0x430/0xf00
[   95.165533]  stmmac_hw_setup from __stmmac_open+0x214/0x2d4
[   95.171117]  __stmmac_open from stmmac_open+0x30/0x44
[   95.176182]  stmmac_open from __dev_open+0x11c/0x134
[   95.181172]  __dev_open from __dev_change_flags+0x168/0x17c
[   95.186750]  __dev_change_flags from dev_change_flags+0x14/0x50
[   95.192662]  dev_change_flags from devinet_ioctl+0x2b4/0x604
[   95.198321]  devinet_ioctl from inet_ioctl+0x1ec/0x214
[   95.203462]  inet_ioctl from sock_ioctl+0x14c/0x3c4
[   95.208354]  sock_ioctl from vfs_ioctl+0x20/0x38
[   95.212984]  vfs_ioctl from sys_ioctl+0x250/0x844
[   95.217691]  sys_ioctl from ret_fast_syscall+0x0/0x4c
[   95.222743] Exception stack(0xd0ee1fa8 to 0xd0ee1ff0)
[   95.227790] 1fa0:                   00574c4f be9aeca4 00000003 00008914 be9aeca4 be9aec50
[   95.235945] 1fc0: 00574c4f be9aeca4 0059f078 00000036 be9aee8c be9aef7a 00000015 00000000
[   95.244096] 1fe0: 005a01f0 be9aec38 004d7484 b6e67d74

Signed-off-by: Piergiorgio Beruto <piergiorgio.beruto@gmail.com>
Fixes: 91a2559c1dc5 ("net: stmmac: Fix sub-second increment")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/de4c64ccac9084952c56a06a8171d738604c4770.1670678513.git.piergiorgio.beruto@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-01-18 11:41:17 +01:00
..
appletalk
arcnet
bonding bonding: uninitialized variable in bond_miimon_inspect() 2023-01-18 11:41:08 +01:00
caif
can can: tcan4x5x: Remove invalid write in clear_interrupts 2023-01-18 11:41:15 +01:00
dsa net: lan9303: Fix read error execution path 2023-01-18 11:41:15 +01:00
ethernet stmmac: fix potential division by 0 2023-01-18 11:41:17 +01:00
fddi net: defxx: Fix missing err handling in dfx_init() 2023-01-18 11:41:13 +01:00
fjes
hamradio hamradio: don't call dev_kfree_skb() under spin_lock_irqsave() 2023-01-18 11:41:15 +01:00
hippi
hyperv hv_netvsc: Fix race between VF offering and VF association message from host 2022-10-29 10:20:36 +02:00
ieee802154 ca8210: Fix crash by zero initializing data 2022-12-14 11:30:44 +01:00
ipvlan ipvlan: Fix out-of-bound bugs caused by unset skb->mac_header 2022-09-28 11:04:05 +02:00
netdevsim netdevsim: Avoid allocation warnings triggered from user space 2022-08-25 11:17:49 +02:00
phy net: phy: fix null-ptr-deref while probe() failed 2022-12-08 11:23:03 +01:00
plip net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq() 2022-12-14 11:30:48 +01:00
ppp
slip
team net: team: Unsync device addresses on ndo_stop 2022-09-28 11:04:05 +02:00
usb net: usb: qmi_wwan: add u-blox 0x1342 composition 2022-12-14 11:30:42 +01:00
vmxnet3
wan net: farsync: Fix kmemleak when rmmods farsync 2023-01-18 11:41:14 +01:00
wimax
wireless wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware() 2023-01-18 11:41:12 +01:00
xen-netback xen-netback: move removal of "hotplug-status" to the right place 2023-01-18 11:40:48 +01:00
dummy.c
eql.c
geneve.c geneve: do not use RT_TOS for IPv6 flowlabel 2022-08-25 11:18:24 +02:00
gtp.c
ifb.c
Kconfig
LICENSE.SRC
loopback.c net: loopback: use NET_NAME_PREDICTABLE for name_assign_type 2023-01-18 11:40:49 +01:00
macsec.c
macvlan.c macvlan: enforce a consistent minimal mtu 2022-11-25 17:42:21 +01:00
macvtap.c
Makefile
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c ntb_netdev: Use dev_kfree_skb_any() in interrupt context 2023-01-18 11:41:16 +01:00
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c net: thunderbolt: Fix error handling in tbnet_init() 2022-11-25 17:42:16 +01:00
tun.c net: tun: Fix use-after-free in tun_detach() 2022-12-08 11:23:03 +01:00
veth.c
virtio_net.c virtio-net: fix the race between refill work and close 2022-08-03 11:59:41 +02:00
vrf.c
vsockmon.c
vxlan.c
xen-netfront.c xen-netfront: Fix NULL sring after live migration 2022-12-14 11:30:45 +01:00