]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
net: usb: smsc95xx: Limit packet length to skb->len
authorSzymon Heidrich <szymon.heidrich@gmail.com>
Thu, 16 Mar 2023 10:19:54 +0000 (11:19 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 18 Mar 2023 04:58:26 +0000 (21:58 -0700)
commitff821092cf02a70c2bccd2d19269f01e29aa52cf
treecc1063d1f9c09c3e4ca0030e1b1cb6983176acb4
parent30796d0dcb6e41c6558a07950f2ce60c209da867
net: usb: smsc95xx: Limit packet length to skb->len

Packet length retrieved from descriptor may be larger than
the actual socket buffer length. In such case the cloned
skb passed up the network stack will leak kernel memory contents.

Fixes: 2f7ca802bdae ("net: Add SMSC LAN9500 USB2.0 10/100 ethernet adapter driver")
Signed-off-by: Szymon Heidrich <szymon.heidrich@gmail.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20230316101954.75836-1-szymon.heidrich@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/usb/smsc95xx.c