]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
net: lan78xx: add missing endpoint sanity check
authorJohan Hovold <johan@kernel.org>
Tue, 28 Jul 2020 12:10:29 +0000 (14:10 +0200)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fri, 4 Sep 2020 19:28:34 +0000 (16:28 -0300)
commita6a3ab782861ca85a7f5580c9e5290682395d24f
tree159856460fc9f6797f61ea8a528d527b5c8c5e40
parent446a9b11c2e10ca80e9f129cc3c2a282f83b2145
net: lan78xx: add missing endpoint sanity check

BugLink: https://bugs.launchpad.net/bugs/1891063
[ Upstream commit 8d8e95fd6d69d774013f51e5f2ee10c6e6d1fc14 ]

Add the missing endpoint sanity check to prevent a NULL-pointer
dereference should a malicious device lack the expected endpoints.

Note that the driver has a broken endpoint-lookup helper,
lan78xx_get_endpoints(), which can end up accepting interfaces in an
altsetting without endpoints as long as *some* altsetting has a bulk-in
and a bulk-out endpoint.

Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver")
Cc: Woojung.Huh@microchip.com <Woojung.Huh@microchip.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Ian May <ian.may@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/net/usb/lan78xx.c