Star64_linux/drivers/net/phy
Gaosheng Cui 12384cf429 net: mdio: fix undefined behavior in bit shift for __mdiobus_register
[ Upstream commit 40e4eb324c ]

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>
2023-04-19 17:55:59 +08:00
..
mscc net: phy: mscc: Add MODULE_FIRMWARE macros 2023-04-19 17:46:22 +08:00
adin.c
amd.c
aquantia.h
aquantia_hwmon.c
aquantia_main.c net: phy: aquantia: wait for the suspend/resume operations to finish 2023-04-19 17:54:02 +08:00
at803x.c net: phy: at803x: move page selection fix to config_init 2023-04-19 17:46:55 +08:00
ax88796b.c net: phy: ax88772a: fix lost pause advertisement configuration 2023-04-19 17:50:53 +08:00
bcm-cygnus.c
bcm-phy-lib.c
bcm-phy-lib.h
bcm7xxx.c
bcm63xx.c
bcm87xx.c
bcm54140.c
bcm84881.c
broadcom.c net: phy: broadcom: Fix brcm_fet_config_init() 2023-04-19 17:47:14 +08:00
cicada.c
cortina.c
davicom.c
dp83tc811.c
dp83640.c
dp83640_reg.h
dp83822.c net: phy: dp83822: disable MDI crossover status change interrupt 2023-04-19 17:55:43 +08:00
dp83848.c
dp83867.c net: phy: dp83867: Extend RX strap quirk for SGMII mode 2023-04-19 17:55:42 +08:00
dp83869.c
et1011c.c
fixed_phy.c
icplus.c
intel-xway.c
Kconfig
linkmode.c
lxt.c
Makefile
marvell-88x2222.c
marvell.c net: phy: marvell: Fix invalid comparison in the resume and suspend functions 2023-04-19 17:46:21 +08:00
marvell10g.c net: phy: marvell10g: fix return value on error 2023-04-19 17:48:27 +08:00
mdio-boardinfo.c
mdio-boardinfo.h
mdio_bus.c net: mdio: fix undefined behavior in bit shift for __mdiobus_register 2023-04-19 17:55:59 +08:00
mdio_device.c
mdio_devres.c
mediatek-ge.c net: phy: mediatek: remove PHY mode check on MT7531 2023-04-19 17:45:30 +08:00
meson-gxl.c Revert "net: phy: meson-gxl: improve link-up behavior" 2023-04-19 17:53:47 +08:00
micrel.c net: phy: micrel: Allow probing without .driver_data 2023-04-19 17:49:28 +08:00
microchip.c
microchip_t1.c
mii_timestamper.c
motorcomm.c
mxl-gpy.c
national.c
nxp-c45-tja11xx.c
nxp-tja11xx.c
phy-c45.c
phy-core.c
phy.c net: phy: Don't trigger state machine while in suspend 2023-04-19 17:50:50 +08:00
phy_device.c net: phy: Don't WARN for PHY_UP state in mdio_bus_phy_resume() 2023-04-19 17:54:12 +08:00
phy_led_triggers.c
phylink.c net: phylink: add mac_managed_pm in phylink_config structure 2023-04-19 17:55:42 +08:00
qsemi.c
realtek.c
rockchip.c
sfp-bus.c net: sfp: add 2500base-X quirk for Lantech SFP module 2023-04-19 17:47:40 +08:00
sfp.c net: sfp: fix memory leak in sfp_probe() 2023-04-19 17:51:25 +08:00
sfp.h
smsc.c net: phy: smsc: Disable Energy Detect Power-Down in interrupt mode 2023-04-19 17:52:56 +08:00
spi_ks8995.c
ste10Xp.c
swphy.c
swphy.h
teranetics.c
uPD60620.c
vitesse.c
xilinx_gmii2rgmii.c