summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2021-09-17 09:13:08 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-03 17:57:50 +0300
commita3f2cc11d6b6cd25edce81fb5b15dfcfd15f82e7 (patch)
tree55f7d17080a810542c14fd32508b6a5e288bcc77 /drivers
parent467230b9ef40526a3b0d0fc4587c2384f17e5a3b (diff)
downloadlinux-a3f2cc11d6b6cd25edce81fb5b15dfcfd15f82e7.tar.xz
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: Jan Beulich <jbeulich@suse.com> Reviewed-by: Juergen Gross <jgross@suse.com> Link: https://lore.kernel.org/r/c2513395-74dc-aea3-9192-fd265aa44e35@suse.com Signed-off-by: Juergen Gross <jgross@suse.com> Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com> Co-authored-by: Demi Marie Obenour <demi@invisiblethingslab.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/xen/gntdev.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
index ff195b571763..1578fd2186b3 100644
--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -395,6 +395,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