WSL2-Linux-Kernel/drivers/xen
Demi Marie Obenour 1e92426e2b 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-21 21:24:23 +02:00
..
events xen/console: harden hvc_xen against event channel storms 2021-12-22 09:32:52 +01:00
xen-pciback
xenbus xen/xenbus: don't let xenbus_grant_ring() remove grants in error case 2022-03-11 12:22:36 +01:00
xenfs
Kconfig
Makefile
acpi.c
arm-device.c
balloon.c
biomerge.c
cpu_hotplug.c
dbgp.c
efi.c
evtchn.c
features.c x86/xen: Remove undefined behavior in setup_features() 2022-06-29 09:03:24 +02:00
gntalloc.c xen/gntalloc: don't use gnttab_query_foreign_access() 2022-03-11 12:22:36 +01:00
gntdev-common.h xen/gntdev: Avoid blocking in unmap_grant_pages() 2022-06-29 09:03:19 +02:00
gntdev-dmabuf.c
gntdev-dmabuf.h
gntdev.c xen/gntdev: Ignore failure to unmap INVALID_GRANT_HANDLE 2022-07-21 21:24:23 +02:00
grant-table.c xen/gnttab: fix gnttab_end_foreign_access() without page specified 2022-03-11 12:22:37 +01:00
manage.c
mcelog.c
mem-reservation.c
pci.c
pcpu.c
platform-pci.c
privcmd-buf.c
privcmd.c
privcmd.h
pvcalls-back.c
pvcalls-front.c xen/pvcalls: use alloc/free_pages_exact() 2022-03-11 12:22:36 +01:00
pvcalls-front.h
swiotlb-xen.c swiotlb: Support aligned swiotlb buffers 2022-04-08 14:24:17 +02:00
sys-hypervisor.c
time.c
unpopulated-alloc.c
xen-acpi-pad.c
xen-acpi-processor.c
xen-balloon.c
xen-front-pgdir-shbuf.c
xen-scsiback.c
xlate_mmu.c xen: unexport __init-annotated xen_xlate_map_ballooned_pages() 2022-06-14 18:36:17 +02:00