Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0fb10476 authored by Jan Beulich's avatar Jan Beulich Committed by Greg Kroah-Hartman
Browse files

Xen/gntdev: don't ignore kernel unmapping error



commit f28347cc66395e96712f5c2db0a302ee75bafce6 upstream.

While working on XSA-361 and its follow-ups, I failed to spot another
place where the kernel mapping part of an operation was not treated the
same as the user space part. Detect and propagate errors and add a 2nd
pr_debug().

Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/c2513395-74dc-aea3-9192-fd265aa44e35@suse.com


Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarDemi Marie Obenour <demi@invisiblethingslab.com>
Co-authored-by: default avatarDemi Marie Obenour <demi@invisiblethingslab.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c6ca9cc3
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -396,6 +396,14 @@ static void __unmap_grant_pages_done(int result,
			map->unmap_ops[offset+i].handle,
			map->unmap_ops[offset+i].status);
		map->unmap_ops[offset+i].handle = -1;
		if (use_ptemod) {
			WARN_ON(map->kunmap_ops[offset+i].status &&
				map->kunmap_ops[offset+i].handle != -1);
			pr_debug("kunmap handle=%u st=%d\n",
				 map->kunmap_ops[offset+i].handle,
				 map->kunmap_ops[offset+i].status);
			map->kunmap_ops[offset+i].handle = -1;
		}
	}
	/*
	 * Decrease the live-grant counter.  This must happen after the loop to