usb: gadget: rndis: check size of RNDIS_MSG_SET command
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Feb 2022 15:37:53 +0000 (16:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Feb 2022 11:56:35 +0000 (12:56 +0100)
commit2da3b0ab54fb7f4d7c5a82757246d0ee33a47197
treeb37b71417d2fe76bc0a86700bdbac412d08ebace
parent3e33e5c67cb9ebd2b791b9a9fb2b71daacebd8d4
usb: gadget: rndis: check size of RNDIS_MSG_SET command

commit 38ea1eac7d88072bbffb630e2b3db83ca649b826 upstream.

Check the size of the RNDIS_MSG_SET command given to us before
attempting to respond to an invalid message size.

Reported-by: Szymon Heidrich <szymon.heidrich@gmail.com>
Cc: stable@kernel.org
Tested-by: Szymon Heidrich <szymon.heidrich@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/rndis.c