Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281025
b: refs/heads/master
c: 2263837
h: refs/heads/master
i:
  281023: 33fb845
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Nov 27, 2011
1 parent 33d15e9 commit 2ba93a6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dba8e1ad957e19ab42c39808a502803dc5b2dee7
refs/heads/master: 226383751ff3ce67a648653e8bfe0842f36bbf96
12 changes: 12 additions & 0 deletions trunk/drivers/staging/hv/hv_mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,18 @@ static void mousevsc_on_receive(struct hv_device *device,

switch (hid_msg->header.type) {
case SYNTH_HID_PROTOCOL_RESPONSE:
/*
* While it will be impossible for us to protect against
* malicious/buggy hypervisor/host, add a check here to
* ensure we don't corrupt memory.
*/
if ((pipe_msg->size + sizeof(struct pipe_prt_msg)
- sizeof(unsigned char))
> sizeof(struct mousevsc_prt_msg)) {
WARN_ON(1);
break;
}

memcpy(&input_dev->protocol_resp, pipe_msg,
pipe_msg->size + sizeof(struct pipe_prt_msg) -
sizeof(unsigned char));
Expand Down

0 comments on commit 2ba93a6

Please sign in to comment.