diff options
author | Haiyang Zhang <haiyangz@microsoft.com> | 2014-10-22 16:47:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-22 17:58:50 -0400 |
commit | 942396b01989d54977120f3625e5ba31afe7a75c (patch) | |
tree | ac54257c97a519c78793b5207bb61562bf4c8963 | |
parent | f765678e325b4ae3e2fbdb304fc2d5ee018aa860 (diff) |
hyperv: Fix the total_data_buflen in send path
total_data_buflen is used by netvsc_send() to decide if a packet can be put
into send buffer. It should also include the size of RNDIS message before the
Ethernet frame. Otherwise, a messge with total size bigger than send_section_size
may be copied into the send buffer, and cause data corruption.
[Request to include this patch to the Stable branches]
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/hyperv/netvsc_drv.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 9e17d1a91e71..78ec33f5100b 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c | |||
@@ -550,6 +550,7 @@ do_lso: | |||
550 | do_send: | 550 | do_send: |
551 | /* Start filling in the page buffers with the rndis hdr */ | 551 | /* Start filling in the page buffers with the rndis hdr */ |
552 | rndis_msg->msg_len += rndis_msg_size; | 552 | rndis_msg->msg_len += rndis_msg_size; |
553 | packet->total_data_buflen = rndis_msg->msg_len; | ||
553 | packet->page_buf_cnt = init_page_array(rndis_msg, rndis_msg_size, | 554 | packet->page_buf_cnt = init_page_array(rndis_msg, rndis_msg_size, |
554 | skb, &packet->page_buf[0]); | 555 | skb, &packet->page_buf[0]); |
555 | 556 | ||