xen-netback: use RING_COPY_REQUEST() throughout
authorDavid Vrabel <david.vrabel@citrix.com>
Fri, 30 Oct 2015 15:17:06 +0000 (15:17 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 22 Jan 2016 21:40:06 +0000 (21:40 +0000)
commitcbc4bd7f5ffddeff26a82f6e35baa6690f3e7474
tree2f0521fae71d5958573610e2ab65177fad18160c
parentcbf0c8563f3eb28d65077242072dbc4d1ac88ce2
xen-netback: use RING_COPY_REQUEST() throughout

commit 68a33bfd8403e4e22847165d149823a2e0e67c9c upstream.

Instead of open-coding memcpy()s and directly accessing Tx and Rx
requests, use the new RING_COPY_REQUEST() that ensures the local copy
is correct.

This is more than is strictly necessary for guest Rx requests since
only the id and gref fields are used and it is harmless if the
frontend modifies these.

This is part of XSA155.

Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
[bwh: Backported to 3.2:
 - s/queue/vif/g
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/xen-netback/netback.c