Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 287477
b: refs/heads/master
c: 4b8a8bc
h: refs/heads/master
i:
  287475: e2d72b1
v: v3
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Feb 2, 2012
1 parent 474ac95 commit 24ae2dc
Show file tree
Hide file tree
Showing 2 changed files with 20 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: c43b874d5d714f271b80d4c3f49e05d0cbf51ed2
refs/heads/master: 4b8a8bc9249f144803d840f2f7608ee9bbf1ea51
19 changes: 19 additions & 0 deletions trunk/drivers/net/hyperv/rndis_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,25 @@ static void rndis_filter_receive_data(struct rndis_device *dev,
data_offset = RNDIS_HEADER_SIZE + rndis_pkt->data_offset;

pkt->total_data_buflen -= data_offset;

/*
* Make sure we got a valid RNDIS message, now total_data_buflen
* should be the data packet size plus the trailer padding size
*/
if (pkt->total_data_buflen < rndis_pkt->data_len) {
netdev_err(dev->net_dev->ndev, "rndis message buffer "
"overflow detected (got %u, min %u)"
"...dropping this message!\n",
pkt->total_data_buflen, rndis_pkt->data_len);
return;
}

/*
* Remove the rndis trailer padding from rndis packet message
* rndis_pkt->data_len tell us the real data length, we only copy
* the data packet to the stack, without the rndis trailer padding
*/
pkt->total_data_buflen = rndis_pkt->data_len;
pkt->data = (void *)((unsigned long)pkt->data + data_offset);

pkt->is_data_pkt = true;
Expand Down

0 comments on commit 24ae2dc

Please sign in to comment.