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

BugLink: https://bugs.launchpad.net/bugs/1966055
Commit 31185df7e2b1d2fa1de4900247a12d7b9c7087eb 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_end_foreign_access_ref() and check the
success of that operation instead.

This is CVE-2022-23037 / 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/net/xen-netfront.c