]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xen/swiotlb: fix condition for calling xen_destroy_contiguous_region()
authorJuergen Gross <jgross@suse.com>
Sun, 1 Sep 2019 23:50:59 +0000 (07:50 +0800)
committerBrian Maly <brian.maly@oracle.com>
Thu, 19 Sep 2019 18:39:49 +0000 (14:39 -0400)
commit403902b6d3777a26f30d91739cfdd55aaea0da60
tree7a6aca89dae8cccc811aabc2504ae49a5b672968
parent57ae52176571b679a4d68722ce6c63047925d334
xen/swiotlb: fix condition for calling xen_destroy_contiguous_region()

The condition in xen_swiotlb_free_coherent() for deciding whether to
call xen_destroy_contiguous_region() is wrong: in case the region to
be freed is not contiguous calling xen_destroy_contiguous_region() is
the wrong thing to do: it would result in inconsistent mappings of
multiple PFNs to the same MFN. This will lead to various strange
crashes or data corruption.

Instead of calling xen_destroy_contiguous_region() in that case a
warning should be issued as that situation should never occur.

Cc: stable@vger.kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
(cherry picked from commit 50f6393f9654c561df4cdcf8e6cfba7260143601)
Orabug: 30141778
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Joe Jin <joe.jin@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/xen/swiotlb-xen.c