xen-netback: use RING_COPY_REQUEST() throughout
authorDavid Vrabel <david.vrabel@citrix.com>
Fri, 30 Oct 2015 15:17:06 +0000 (15:17 +0000)
committerZefan Li <lizefan@huawei.com>
Wed, 26 Oct 2016 15:15:39 +0000 (23:15 +0800)
commitf97ed0a98cd26a2fa7249e7bad44e84091e19b17
treec2560348120ce6f30c4fc14efb5d150e027ced24
parentac2ce7ef843b5f2b1aec3116f5f55ccde179aa9e
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>
[lizf: Backported to 3.4:
 - adjust context
 - s/queue/vif/g]
Signed-off-by: Zefan Li <lizefan@huawei.com>
drivers/net/xen-netback/netback.c