]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
xen/scsifront: don't use gnttab_query_foreign_access() for mapped status
authorJuergen Gross <jgross@suse.com>
Fri, 25 Feb 2022 15:05:42 +0000 (16:05 +0100)
committerPaolo Pisati <paolo.pisati@canonical.com>
Wed, 23 Mar 2022 10:47:07 +0000 (11:47 +0100)
commitb7ba93868ec9bf75faf2c07b94e1cf8db4505d80
tree1fc8d56975cfcaf73105e466e6bdf4b30cdc25c4
parentb602c2e0621d9cc272ee472cb5283f7b4a8a50d9
xen/scsifront: don't use gnttab_query_foreign_access() for mapped status

BugLink: https://bugs.launchpad.net/bugs/1966055
Commit 33172ab50a53578a95691310f49567c9266968b0 upstream.

It isn't enough to check whether a grant is still being in use by
calling gnttab_query_foreign_access(), as a mapping could be realized
by the other side just after having called that function.

In case the call was done in preparation of revoking a grant it is
better to do so via gnttab_try_end_foreign_access() and check the
success of that operation instead.

This is CVE-2022-23038 / part of XSA-396.

Reported-by: Demi Marie Obenour <demi@invisiblethingslab.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/scsi/xen-scsifront.c