mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
UPSTREAM: USB: rndis: Fix for handling garbled messages
A message can be forged to crash the stack; here we make sure we don't
completely break the system if this occurs
Change-Id: Id5ae7509c7d629c62ce5fe567c551a1e424e0bf3
Signed-off-by: Michel Pollet <michel.pollet@bp.renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 1ca532e991)
This commit is contained in:
@@ -866,6 +866,9 @@ int rndis_msg_parser(struct rndis_params *params, u8 *buf)
|
||||
*/
|
||||
pr_warning("%s: unknown RNDIS message 0x%08X len %d\n",
|
||||
__func__, MsgType, MsgLength);
|
||||
/* Garbled message can be huge, so limit what we display */
|
||||
if (MsgLength > 16)
|
||||
MsgLength = 16;
|
||||
print_hex_dump_bytes(__func__, DUMP_PREFIX_OFFSET,
|
||||
buf, MsgLength);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user