Re: [PATCH v7 0/2] usb: gadget: u_ether: fix out-of-bounds read in get_ether_addr

From: Greg Kroah-Hartman

Date: Tue Dec 01 2026 - 01:07:05 EST


On Tue, Dec 01, 2026 at 10:44:13AM +0800, Liu Chao wrote:
> Rework of
>
> [PATCH v6] usb: gadget: u_ether: fix out-of-bounds read in get_ether_addr
> https://lore.kernel.org/all/20261128080722.1469508-1-liuc63@xxxxxxxxxxxx/
>
> following Andy's reply on the v6 2/2 thread: 1/2 prepares a parse_mac_pton()
> helper in lib/net_utils.c, 2/2 uses it in get_ether_addr().
>
> The two patches belong to different trees: 1/2 touches lib/ and should go via
> netdev or -mm, 2/2 is for the USB tree. 2/2 depends on 1/2, so it can only be
> applied once 1/2 has reached Linus' tree.

That's not going to work well, are you sure this is the only way to
resolve this?

This feels like a crazy complex patch for an issue that is
self-inflicted. Why not just resolve it in the gadget driver alone if
it wants to handle such crazy inputs?

greg k-h