linux/drivers/net/phy
Gaosheng Cui 40e4eb324c net: mdio: fix undefined behavior in bit shift for __mdiobus_register
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>
2022-11-02 20:30:51 -07:00
..
mscc net: phy: mscc: macsec: remove checks on the prepare phase 2022-09-23 06:56:08 -07:00
adin1100.c net: phy: adin1100: add PHY IDs of adin1110/adin2111 2022-09-20 15:00:30 +02:00
adin.c net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
amd.c
aquantia_hwmon.c
aquantia_main.c net: phy: aquantia: Add support for rate matching 2022-09-23 11:56:18 +01:00
aquantia.h
at803x.c treewide: use prandom_u32_max() when possible, part 1 2022-10-11 17:42:55 -06:00
ax88796b.c net: phy: ax88772a: fix lost pause advertisement configuration 2022-06-29 20:39:05 -07:00
bcm7xxx.c
bcm63xx.c
bcm87xx.c net: phy: bcm87xx: Use mmd helpers 2022-05-02 13:21:38 +02:00
bcm54140.c
bcm84881.c
bcm-cygnus.c
bcm-phy-lib.c net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
bcm-phy-lib.h net: phy: broadcom: Add Broadcom PTP hooks to bcm-phy-lib 2022-06-23 20:49:02 -07:00
bcm-phy-ptp.c net: phy: Add support for 1PPS out and external timestamps 2022-06-23 20:49:02 -07:00
broadcom.c net: phy: broadcom: Implement suspend/resume for AC131 and BCM5241 2022-08-17 11:49:23 +01:00
cicada.c
cortina.c
davicom.c
dp83tc811.c
dp83td510.c net: phy: dp83td510: add SQI support 2022-06-21 22:01:14 -07:00
dp83640_reg.h
dp83640.c dp83640: Use generic ptp_msg_is_sync() function 2022-03-07 11:31:34 +00:00
dp83822.c net: phy: dp83822: disable MDI crossover status change interrupt 2022-10-19 18:46:17 -07:00
dp83848.c
dp83867.c net: phy: dp83867: Extend RX strap quirk for SGMII mode 2022-10-15 11:10:56 +01:00
dp83869.c net: phy: add support for TI DP83561-SP phy 2021-11-19 20:13:07 -08:00
et1011c.c
fixed_phy.c net: phy: fixed_phy: set phy_mask before calling mdiobus_register() 2022-06-13 23:11:24 -07:00
icplus.c
intel-xway.c
Kconfig net: phy: mxl-gpy: add temperature sensor 2022-06-23 20:55:18 -07:00
linkmode.c
lxt.c
Makefile net: phy: broadcom: Add PTP support for some Broadcom PHYs. 2022-06-23 20:49:02 -07:00
marvell10g.c net: phy: marvell10g: select host interface configuration 2022-10-03 11:08:32 +01:00
marvell-88x2222.c net: sfp: augment SFP parsing with phy_interface_t bitmap 2022-10-03 11:08:32 +01:00
marvell.c net: sfp: augment SFP parsing with phy_interface_t bitmap 2022-10-03 11:08:32 +01:00
mdio_bus.c net: mdio: fix undefined behavior in bit shift for __mdiobus_register 2022-11-02 20:30:51 -07:00
mdio_device.c
mdio_devres.c
mdio-boardinfo.c
mdio-boardinfo.h
mediatek-ge.c net: phy: mediatek: remove PHY mode check on MT7531 2022-02-15 14:21:01 +00:00
meson-gxl.c Revert "net: phy: meson-gxl: improve link-up behavior" 2022-09-01 20:55:12 -07:00
micrel.c net: phy: micrel: Fixes FIELD_GET assertion 2022-10-12 17:51:33 -07:00
microchip_t1.c net: phy: lan87xx: change interrupt src of link_up to comm_ready 2022-09-08 11:02:44 +02:00
microchip.c net: phy: microchip: add comments for the modified LAN88xx phy ID mask. 2022-05-10 18:57:14 -07:00
mii_timestamper.c
motorcomm.c
mxl-gpy.c net: phy: mxl-gpy: print firmware in human readable form 2022-07-13 14:18:39 +01:00
national.c
nxp-c45-tja11xx.c net: phy: Use netif_rx(). 2022-03-06 11:05:31 +00:00
nxp-tja11xx.c net: phy: tja11xx: add interface mode and RMII REF_CLK support 2022-08-23 17:43:28 -07:00
phy_device.c net: mdiobus: search for PSE nodes by parsing PHY nodes. 2022-10-03 17:33:57 -07:00
phy_led_triggers.c
phy-c45.c net: phy: c45 baset1: do not skip aneg configuration if clock role is not specified 2022-08-08 20:54:28 -07:00
phy-core.c net: phy: Add support for rate matching 2022-09-23 11:55:35 +01:00
phy.c net: phy: Add support for rate matching 2022-09-23 11:55:35 +01:00
phylink.c net: phylink: add mac_managed_pm in phylink_config structure 2022-10-15 11:51:51 +01:00
qsemi.c
realtek.c net: phy: realtek: add support for RTL8211F(D)(I)-VD-CG 2022-08-22 12:47:18 +01:00
rockchip.c
sfp-bus.c net: sfp: fill also 5gbase-r and 25gbase-r modes in sfp_parse_support() 2022-10-10 18:00:29 -07:00
sfp.c net: sfp: add support for multigig RollBall transceivers 2022-10-03 11:08:33 +01:00
sfp.h net: sfp: augment SFP parsing with phy_interface_t bitmap 2022-10-03 11:08:32 +01:00
smsc.c net: phy: smsc: use device-managed clock API 2022-08-31 12:19:18 -07:00
spi_ks8995.c net: phy: spi_ks8895: switch to using gpiod API 2022-09-15 11:43:51 +02:00
ste10Xp.c
swphy.c
swphy.h
teranetics.c
uPD60620.c
vitesse.c
xilinx_gmii2rgmii.c