hyperv: Fix the total_data_buflen in send path
Subsystems (3)
Haiyang Zhang
maintainerPATCH 1/1 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]
--- drivers/net/hyperv/netvsc_drv.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/hyperv/netvsc_drv.c +1 -0
@@ -550,6 +550,7 @@ do_lso: do_send:/* Start filling in the page buffers with the rndis hdr */ rndis_msg->msg_len += rndis_msg_size; + packet->total_data_buflen = rndis_msg->msg_len; packet->page_buf_cnt =init_page_array (rndis_msg, rndis_msg_size, skb, &packet->page_buf[0 ]);
Signature · 1 line
1.7.1
David Miller
maintainerFrom: Haiyang Zhang <[email protected]>
Date: Wed, 22 Oct 2014 13:47:18 -0700
Quoted 9 lines
total_data_buflenis used bynetvsc_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 thansend_section_sizemay be copied into the send buffer, and cause data corruption.[Request to include this patch to the Stable branches]
Signed-off-by Haiyang Zhang <[email protected]>Reviewed-by K. Y. Srinivasan <[email protected]>
Applied and queued up for -stable, thanks.