Commit 93df9d57 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Zheng Zengkai
Browse files

USB: gadget: detect too-big endpoint 0 requests

stable inclusion
form stable-v5.10.85
commit 7193ad3e50e596ac2192531c58ba83b9e6d2444b
bugzilla: 185937 https://gitee.com/openeuler/kernel/issues/I4DDEL
CVE: CVE-2021-39685

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7193ad3e50e596ac2192531c58ba83b9e6d2444b



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

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 avatarChen Jun <chenjun102@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 64ab4c23
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment