Commit ee3b7a69 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Yang Yingliang
Browse files

USB: gadget: detect too-big endpoint 0 requests



mainline inclusion
from mainline-v5.16-rc5
commit 153a2d7e
category: bugfix
bugzilla: NA
CVE: CVE-2021-39685

--------------------------------

Sometimes USB hosts can ask for buffers that are too large from endpoint
0, which should not be allowed.  If this happens for OUT requests, stall
the endpoint, but for IN requests, trim the request size to the endpoint
buffer size.

Co-developed-by: default avatarSzymon Heidrich <szymon.heidrich@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 39138737
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment