]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 13:17:38 +0000 (15:17 +0200)
commitf456a5bc6c36b862d8498cbc51b6f23e3d930d37
tree6de54debcd359265ce6c00399657931c0089de65
parentc930b62d729f51987711bc634b74368d08a8e630
xen/netfront: don't use gnttab_query_foreign_access() for mapped status

BugLink: https://bugs.launchpad.net/bugs/1969242
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: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/xen-netfront.c