From: Greg Kroah-Hartman Date: Sun, 11 Nov 2018 14:15:39 +0000 (-0800) Subject: drop xen-swiotlb-use-actually-allocated-size-on-check-physical-continuous.patch from... X-Git-Tag: v4.19.2~51 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8eaf747ce0bdd932f1e13b32e7bd022dee1a4797;p=thirdparty%2Fkernel%2Fstable-queue.git drop xen-swiotlb-use-actually-allocated-size-on-check-physical-continuous.patch from 3.18 --- diff --git a/queue-3.18/series b/queue-3.18/series index 7e80df33eff..62d48f99fff 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -27,7 +27,6 @@ usb-chipidea-prevent-unbalanced-irq-disable.patch uio-ensure-class-is-registered-before-devices.patch scsi-lpfc-correct-soft-lockup-when-running-mds-diagnostics.patch signal-always-deliver-the-kernel-s-sigkill-and-sigstop-to-a-pid-namespace-init.patch -xen-swiotlb-use-actually-allocated-size-on-check-physical-continuous.patch net-ipv4-defensive-cipso-option-parsing.patch jbd2-fix-use-after-free-in-jbd2_log_do_checkpoint.patch gfs2_meta-mount-can-get-null-dev_name.patch diff --git a/queue-3.18/xen-swiotlb-use-actually-allocated-size-on-check-physical-continuous.patch b/queue-3.18/xen-swiotlb-use-actually-allocated-size-on-check-physical-continuous.patch deleted file mode 100644 index c05d60d2bde..00000000000 --- a/queue-3.18/xen-swiotlb-use-actually-allocated-size-on-check-physical-continuous.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 7250f422da0480d8512b756640f131b9b893ccda Mon Sep 17 00:00:00 2001 -From: Joe Jin -Date: Tue, 16 Oct 2018 15:21:16 -0700 -Subject: xen-swiotlb: use actually allocated size on check physical continuous - -From: Joe Jin - -commit 7250f422da0480d8512b756640f131b9b893ccda upstream. - -xen_swiotlb_{alloc,free}_coherent() allocate/free memory based on the -order of the pages and not size argument (bytes). This is inconsistent with -range_straddles_page_boundary and memset which use the 'size' value, -which may lead to not exchanging memory with Xen (range_straddles_page_boundary() -returned true). And then the call to xen_swiotlb_free_coherent() would -actually try to exchange the memory with Xen, leading to the kernel -hitting an BUG (as the hypercall returned an error). - -This patch fixes it by making the 'size' variable be of the same size -as the amount of memory allocated. - -CC: stable@vger.kernel.org -Signed-off-by: Joe Jin -Cc: Konrad Rzeszutek Wilk -Cc: Boris Ostrovsky -Cc: Christoph Helwig -Cc: Dongli Zhang -Cc: John Sobecki -Signed-off-by: Konrad Rzeszutek Wilk -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/xen/swiotlb-xen.c | 6 ++++++ - 1 file changed, 6 insertions(+) - ---- a/drivers/xen/swiotlb-xen.c -+++ b/drivers/xen/swiotlb-xen.c -@@ -314,6 +314,9 @@ xen_swiotlb_alloc_coherent(struct device - if (dma_alloc_from_coherent(hwdev, size, dma_handle, &ret)) - return ret; - -+ /* Convert the size to actually allocated. */ -+ size = 1UL << (order + XEN_PAGE_SHIFT); -+ - /* On ARM this function returns an ioremap'ped virtual address for - * which virt_to_phys doesn't return the corresponding physical - * address. In fact on ARM virt_to_phys only works for kernel direct -@@ -366,6 +369,9 @@ xen_swiotlb_free_coherent(struct device - * physical address */ - phys = xen_bus_to_phys(dev_addr); - -+ /* Convert the size to actually allocated. */ -+ size = 1UL << (order + XEN_PAGE_SHIFT); -+ - if (((dev_addr + size - 1 <= dma_mask)) || - range_straddles_page_boundary(phys, size)) - xen_destroy_contiguous_region(phys, order);