vfio: fix vfio_info_cap_add/shift
authorEric Auger <eric.auger@redhat.com>
Mon, 21 Nov 2016 06:21:02 +0000 (07:21 +0100)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 21 Nov 2016 18:51:53 +0000 (11:51 -0700)
commit5ba6de98c78ac45166036516e34bec487887ba5d
treec7102457c64e098736aab3ca8a11c21b53a34116
parentf4cb410019388e450388ab001bb639b018558b71
vfio: fix vfio_info_cap_add/shift

Capability header next field is an offset relative to the start of
the INFO buffer. tmp->next is assigned the proper value but iterations
implemented in vfio_info_cap_add and vfio_info_cap_shift use next
as an offset between the headers. When coping with multiple capabilities
this leads to an Oops.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio.c