linux-stable/drivers/xen
Demi Marie Obenour 7fb77b292a xen/gntdev: Ignore failure to unmap INVALID_GRANT_HANDLE
[ Upstream commit 166d386323 ]

The error paths of gntdev_mmap() can call unmap_grant_pages() even
though not all of the pages have been successfully mapped.  This will
trigger the WARN_ON()s in __unmap_grant_pages_done().  The number of
warnings can be very large; I have observed thousands of lines of
warnings in the systemd journal.

Avoid this problem by only warning on unmapping failure if the handle
being unmapped is not INVALID_GRANT_HANDLE.  The handle field of any
page that was not successfully mapped will be INVALID_GRANT_HANDLE, so
this catches all cases where unmapping can legitimately fail.

Fixes: dbe97cff7d ("xen/gntdev: Avoid blocking in unmap_grant_pages()")
Cc: stable@vger.kernel.org
Suggested-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com>
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20220710230522.1563-1-demi@invisiblethingslab.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-07-22 10:21:34 +02:00
..
events xen/console: harden hvc_xen against event channel storms 2021-12-16 08:24:08 +01:00
xen-pciback xen-pciback: allow compiling on other archs than x86 2021-11-02 08:03:43 -05:00
xenbus xen/xenbus: don't let xenbus_grant_ring() remove grants in error case 2022-03-07 09:48:54 +01:00
xenfs
acpi.c
arm-device.c
balloon.c xen/balloon: don't use PV mode extra memory for zone device allocations 2022-04-07 15:08:37 -05:00
biomerge.c
cpu_hotplug.c
dbgp.c
efi.c
evtchn.c xen/evtchn: use READ/WRITE_ONCE() for accessing ring indices 2021-02-23 10:07:52 -06:00
features.c x86/xen: Remove undefined behavior in setup_features() 2022-06-29 09:04:33 +02:00
gntalloc.c xen: Convert kmap() to kmap_local_page() 2022-04-20 15:22:18 -05:00
gntdev-common.h xen/gntdev: Avoid blocking in unmap_grant_pages() 2022-06-29 09:04:26 +02:00
gntdev-dmabuf.c xen/grant-table: remove readonly parameter from functions 2022-03-15 20:34:40 -05:00
gntdev-dmabuf.h
gntdev.c xen/gntdev: Ignore failure to unmap INVALID_GRANT_HANDLE 2022-07-22 10:21:34 +02:00
grant-table.c xen/grant-table: remove readonly parameter from functions 2022-03-15 20:34:40 -05:00
Kconfig arm/xen: Read extended regions from DT and init Xen resource 2022-01-06 09:53:41 +01:00
Makefile xen-pciback: allow compiling on other archs than x86 2021-11-02 08:03:43 -05:00
manage.c xen: don't hang when resuming PCI device 2022-03-25 14:22:15 -05:00
mcelog.c
mem-reservation.c x86/xen: remove 32-bit pv leftovers 2021-11-02 08:03:43 -05:00
pci.c xen/pci: Make use of the helper macro LIST_HEAD() 2022-02-10 11:10:23 +01:00
pcpu.c xen: Use DEVICE_ATTR_*() macro 2021-07-05 09:23:31 +02:00
platform-pci.c
privcmd-buf.c
privcmd.c xen/privcmd: drop "pages" parameter from xen_remap_pfn() 2021-10-05 08:20:27 +02:00
privcmd.h
pvcalls-back.c xen/pvcalls-back: Remove redundant 'flush_workqueue()' calls 2021-11-02 07:45:44 -05:00
pvcalls-front.c xen/grant-table: remove readonly parameter from functions 2022-03-15 20:34:40 -05:00
pvcalls-front.h
swiotlb-xen.c Merge branch 'akpm' (patches from Andrew) 2021-11-06 14:08:17 -07:00
sys-hypervisor.c drivers/xen: use helper macro __ATTR_RW 2022-03-10 09:27:55 -06:00
time.c x86/paravirt: Switch time pvops functions to use static_call() 2021-03-11 16:17:52 +01:00
unpopulated-alloc.c xen/balloon: don't use PV mode extra memory for zone device allocations 2022-04-07 15:08:37 -05:00
xen-acpi-pad.c
xen-acpi-processor.c xen: Fix implicit type conversion 2021-11-02 07:45:44 -05:00
xen-balloon.c xen: Use DEVICE_ATTR_*() macro 2021-07-05 09:23:31 +02:00
xen-front-pgdir-shbuf.c xen/grant-table: remove readonly parameter from functions 2022-03-15 20:34:40 -05:00
xen-scsiback.c isystem: trim/fixup stdarg.h and other headers 2021-08-19 09:02:55 +09:00
xlate_mmu.c xen: unexport __init-annotated xen_xlate_map_ballooned_pages() 2022-06-14 18:45:05 +02:00