[PATCH] usb: gadget: dfu: Fix the unchecked length field
authorVenkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Thu, 3 Nov 2022 04:07:48 +0000 (09:37 +0530)
committerDaniel Leidert <dleidert@debian.org>
Sun, 29 Jun 2025 00:33:57 +0000 (02:33 +0200)
commit045a0ce6b6d3aaccbff7535d076fb4c89f483856
treec3fbb69d7f85c381689530604a4058945d5496e5
parentde7fe47886aa41b76fe476fdb856f574e473e883
[PATCH] usb: gadget: dfu: Fix the unchecked length field

DFU implementation does not bound the length field in USB
DFU download setup packets, and it does not verify that
the transfer direction. Fixing the length and transfer
direction.

CVE-2022-2347

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Note (<dleidert>: I'm not sure if this patch should be applied as well:
https://source.denx.de/u-boot/u-boot/-/commit/86b6a38863bebb70a65a53f93a1ffafc4a472169

It is not related to the issue, though.

Reviewed-By: Daniel Leidert <dleidert@debian.org>
Origin: https://source.denx.de/u-boot/u-boot/-/commit/fbce985e28eaca3af82afecc11961aadaf971a7e
Bug: https://www.openwall.com/lists/oss-security/2022/07/08/2
Bug-Debian: https://bugs.debian.org/1014959
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2022-2347
Bug-Freexian-Security: https://deb.freexian.com/extended-lts/tracker/CVE-2022-2347

Gbp-Pq: Name CVE-2022-2347.patch
drivers/usb/gadget/f_dfu.c