]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: usb: asix_devices: Fix PHY address mask in MDIO bus initialization
authorYuichiro Tsuji <yuichtsu@amazon.com>
Mon, 18 Aug 2025 08:45:07 +0000 (17:45 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:31:14 +0000 (16:31 +0200)
commit22042ffedd8c2c6db08ccdd6d4273068eddd3c5c
treed37df7cdf39717171e2e9ad1ccb31a3ed1913cfd
parent78ba077e323f14fb9854d72e1834fba8b0a8c25e
net: usb: asix_devices: Fix PHY address mask in MDIO bus initialization

[ Upstream commit 24ef2f53c07f273bad99173e27ee88d44d135b1c ]

Syzbot reported shift-out-of-bounds exception on MDIO bus initialization.

The PHY address should be masked to 5 bits (0-31). Without this
mask, invalid PHY addresses could be used, potentially causing issues
with MDIO bus operations.

Fix this by masking the PHY address with 0x1f (31 decimal) to ensure
it stays within the valid range.

Fixes: 4faff70959d5 ("net: usb: asix_devices: add phy_mask for ax88772 mdio bus")
Reported-by: syzbot+20537064367a0f98d597@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=20537064367a0f98d597
Tested-by: syzbot+20537064367a0f98d597@syzkaller.appspotmail.com
Signed-off-by: Yuichiro Tsuji <yuichtsu@amazon.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20250818084541.1958-1-yuichtsu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/usb/asix_devices.c