forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/net/usb/rndis_host.c
....@@ -255,7 +255,8 @@
255255
256256 off = le32_to_cpu(u.get_c->offset);
257257 len = le32_to_cpu(u.get_c->len);
258
- if (unlikely((8 + off + len) > CONTROL_BUFFER_SIZE))
258
+ if (unlikely((off > CONTROL_BUFFER_SIZE - 8) ||
259
+ (len > CONTROL_BUFFER_SIZE - 8 - off)))
259260 goto response_error;
260261
261262 if (*reply_len != -1 && len != *reply_len)