USB: gadget: validate interface OS descriptor requests
authorSzymon Heidrich <szymon.heidrich@gmail.com>
Mon, 24 Jan 2022 11:14:00 +0000 (12:14 +0100)
committerPDO SCM Team <hudsoncm@motorola.com>
Wed, 4 May 2022 14:26:32 +0000 (09:26 -0500)
commit7e986d44dc2c7edc9ae49e8cd5a67b83ac4ec03d
tree912610ff9175d4d34f97f581b77852d05d6cbe19
parent35e47904af463d54dc6359acb3ab0d41989e2f74
USB: gadget: validate interface OS descriptor requests

commit 75e5b4849b81e19e9efe1654b30d7f3151c33c2c upstream.

Stall the control endpoint in case provided index exceeds array size of
MAX_CONFIG_INTERFACES or when the retrieved function pointer is null.

Mot-CRs-fixed: (CR)
CVE-Fixed: CVE-2022-20009
Bug: 213172319

Change-Id: I12124d435012f99fe266e75c49db35f68e3c9aad
Signed-off-by: Szymon Heidrich <szymon.heidrich@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Gajjala Chakradhar <gajjalac@motorola.com>
Reviewed-on: https://gerrit.mot.com/2242218
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
drivers/usb/gadget/composite.c