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)
committerTom Rini <trini@konsulko.com>
Mon, 21 Nov 2022 14:23:00 +0000 (09:23 -0500)
commitfbce985e28eaca3af82afecc11961aadaf971a7e
treed087f00cc8ecaaaae5ea1de5a7a9729141338448
parent8fc220d0a6c616ac5174c48a07bbc39efc5c0837
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>
drivers/usb/gadget/f_dfu.c