net/hyperv: Fix data corruption in rndis_filter_receive()
authorHaiyang Zhang <haiyangz@microsoft.com>
Mon, 12 Mar 2012 10:20:49 +0000 (10:20 +0000)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Mon, 2 Apr 2012 20:25:36 +0000 (13:25 -0700)
commit63f9e81785d0ed39c7392c26fb853807fc683205
treef74ef703500f7944201c1c2ded9a11a769e81fbe
parent6fc430b9528c76c158af39f1865afadabc5a2fcb
net/hyperv: Fix data corruption in rndis_filter_receive()

Limiting the memcpy to be the sizeof(struct rndis_message) can truncate
the message if there are Per-Packet-Info or Out-of-Band data.

In my earlier patch (commit 45326342), the unnecessary kmap_atomic and
kunmap_atomic surrounding this memcpy have been removed because the memory
in the receive buffer is always mapped. This memcpy is not necessary
either. To fix the bug, I removed the memcpy.

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>
(cherry picked from commit ef31bef6216db76950c38f1993b45953402f4c63)

Signed-off-by: Andy Whitcroft <apw@canonical.com>
drivers/net/hyperv/rndis_filter.c