android_kernel_xiaomi_sm7250/drivers/net/phy
Gaosheng Cui a3fafc974b net: mdio: fix undefined behavior in bit shift for __mdiobus_register
[ Upstream commit 40e4eb324c59e11fcb927aa46742d28aba6ecb8a ]

Shifting signed 32-bit value by 31 bits is undefined, so changing
significant bit to unsigned. The UBSAN warning calltrace like below:

UBSAN: shift-out-of-bounds in drivers/net/phy/mdio_bus.c:586:27
left shift of 1 by 31 places cannot be represented in type 'int'
Call Trace:
 <TASK>
 dump_stack_lvl+0x7d/0xa5
 dump_stack+0x15/0x1b
 ubsan_epilogue+0xe/0x4e
 __ubsan_handle_shift_out_of_bounds+0x1e7/0x20c
 __mdiobus_register+0x49d/0x4e0
 fixed_mdio_bus_init+0xd8/0x12d
 do_one_initcall+0x76/0x430
 kernel_init_freeable+0x3b3/0x422
 kernel_init+0x24/0x1e0
 ret_from_fork+0x1f/0x30
 </TASK>

Fixes: 4fd5f812c2 ("phylib: allow incremental scanning of an mii bus")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20221031132645.168421-1-cuigaosheng1@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-10 17:46:53 +01:00
..
amd.c
aquantia.c
at803x.c
ax88796b.c
bcm7xxx.c net: phy: bcm7xxx: Fixed indirect MMD operations 2021-10-17 10:19:48 +02:00
bcm63xx.c
bcm87xx.c
bcm-cygnus.c
bcm-phy-lib.c net: phy: broadcom: Only advertise EEE for supported modes 2021-04-16 11:49:30 +02:00
bcm-phy-lib.h
broadcom.c net: phy: broadcom: Fix brcm_fet_config_init() 2022-04-15 14:14:53 +02:00
cicada.c
cortina.c
davicom.c
dp83tc811.c
dp83640_reg.h ptp: dp83640: don't define PAGE0 2021-09-22 11:48:11 +02:00
dp83640.c net: dp83640: fix SIOCSHWTSTAMP to update the struct with actual configuration 2020-07-29 10:16:49 +02:00
dp83822.c net: dp83822: disable rx error interrupt 2022-09-20 12:26:48 +02:00
dp83848.c
dp83867.c net: phy: dp83867: enable robust auto-mdix 2019-12-31 16:35:27 +01:00
et1011c.c
fixed_phy.c net: phy: fixed_phy: Fix fixed_phy not checking GPIO 2020-01-27 14:50:20 +01:00
icplus.c
intel-xway.c
Kconfig mdio: fix mdio-thunder.c dependency & build error 2020-10-14 10:31:25 +02:00
lxt.c
Makefile
marvell10g.c
marvell.c net: phy: marvell: Fix MDI-x polarity setting in 88e1118-compatible PHYs 2022-02-16 12:51:43 +01:00
mdio_bus.c net: mdio: fix undefined behavior in bit shift for __mdiobus_register 2022-11-10 17:46:53 +01:00
mdio_device.c net: mdio: introduce a shutdown method to mdio device drivers 2021-10-09 14:11:03 +02:00
mdio-bcm-iproc.c net: phy: restore mdio regs in the iproc mdio driver 2020-03-05 16:42:16 +01:00
mdio-bcm-unimac.c net: phy: mdio-bcm-unimac: mark PM functions as __maybe_unused 2019-11-20 18:47:53 +01:00
mdio-bitbang.c
mdio-boardinfo.c
mdio-boardinfo.h
mdio-cavium.c
mdio-cavium.h
mdio-gpio.c
mdio-hisi-femac.c
mdio-i2c.c
mdio-i2c.h
mdio-moxart.c
mdio-mscc-miim.c
mdio-mux-bcm-iproc.c net: phy: mdio-mux-bcm-iproc: check clk_prepare_enable() return value 2020-04-02 15:28:13 +02:00
mdio-mux-gpio.c
mdio-mux-mmioreg.c
mdio-mux.c net: mdio-mux: Handle -EPROBE_DEFER correctly 2021-08-26 08:36:47 -04:00
mdio-octeon.c net: mdio: octeon: Fix some double free issues 2021-06-03 08:38:11 +02:00
mdio-sun4i.c
mdio-thunder.c net: mdio: thunder: Fix a double free issue in the .remove function 2021-06-03 08:38:11 +02:00
mdio-xgene.c
mdio-xgene.h
meson-gxl.c
micrel.c net: phy: micrel: Allow probing without .driver_data 2022-06-14 16:59:17 +02:00
microchip_t1.c
microchip.c
mscc.c net: phy: mscc: read 'vsc8531, edge-slowdown' as an u32 2019-11-20 18:45:53 +01:00
national.c net/phy: fix DP83865 10 Mbps HDX loopback disable function 2019-10-05 13:09:27 +02:00
phy_device.c phylib: fix potential use-after-free 2022-02-08 18:23:10 +01:00
phy_led_triggers.c
phy-c45.c
phy-core.c
phy.c net: phy: fix save wrong speed and duplex problem if autoneg is on 2021-03-17 16:43:45 +01:00
phylink.c net: sfp: ignore disabled SFP node 2022-02-08 18:23:06 +01:00
qsemi.c
realtek.c
rockchip.c
sfp-bus.c net: sfp: add some quirks for GPON modules 2020-07-22 09:32:03 +02:00
sfp.c net: sfp: fix memory leak in sfp_probe() 2022-07-21 21:09:31 +02:00
sfp.h
smsc.c
spi_ks8995.c
ste10Xp.c
swphy.c
swphy.h
teranetics.c
uPD60620.c
vitesse.c
xilinx_gmii2rgmii.c