From: Demi Marie Obenour <demi@invisiblethingslab.com>
To: Xen developer discussion <xen-devel@lists.xenproject.org>
Cc: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
Subject: “Backend has not unmapped grant” errors
Date: Tue, 23 Aug 2022 03:40:09 -0400 [thread overview]
Message-ID: <YwSEXonOg1CMzeQv@itl-email> (raw)
[-- Attachment #1: Type: text/plain, Size: 1376 bytes --]
I recently had a VM’s /dev/xvdb stop working with a “backend has not
unmapped grant” error. Since /dev/xvdb was the VM’s private volume,
that rendered the VM effectively useless. I had to kill it with
qvm-kill.
The backend of /dev/xvdb is dom0, so a malicious backend is clearly not
the cause of this. I believe the actual cause is a race condition, such
as the following:
1. GUI agent in VM allocates grant X.
2. GUI agent tells GUI daemon in dom0 to map X.
3. GUI agent frees grant X.
4. blkfront allocates grant X and passes it to dom0.
5. dom0’s blkback maps grant X.
6. blkback unmaps grant X.
7. GUI daemon maps grant X.
8. blkfront tries to revoke access to grant X and fails. Disaster
ensues.
What could be done to prevent this race? Right now all of the
approaches I can think of are horribly backwards-incompatible. They
require replacing grant IDs with some sort of handle, and requiring
userspace to pass these handles to ioctls. It is also possible that
netfront and blkfront could race against each other in a way that causes
this, though I suspect that race would be much harder to trigger.
This has happened more than once so it is not a fluke due to e.g. cosmic
rays or other random bit-flips.
Marek, do you have any suggestions?
--
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next reply other threads:[~2022-08-23 7:40 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-23 7:40 Demi Marie Obenour [this message]
2022-08-23 7:48 ` “Backend has not unmapped grant” errors Juergen Gross
2022-08-24 0:20 ` Marek Marczykowski-Górecki
2022-08-24 6:02 ` Juergen Gross
2022-08-24 6:30 ` Jan Beulich
2022-08-24 6:36 ` Juergen Gross
2022-08-24 6:40 ` Jan Beulich
2022-08-24 17:44 ` SeongJae Park
2022-08-24 20:38 ` SeongJae Park
2022-08-25 6:20 ` Juergen Gross
2022-08-25 16:22 ` SeongJae Park
2022-08-24 6:11 ` Juergen Gross
2022-08-28 5:15 ` Demi Marie Obenour
2022-08-29 12:55 ` Juergen Gross
2022-08-29 14:39 ` Marek Marczykowski-Górecki
2022-08-29 16:03 ` Juergen Gross
2022-08-29 18:32 ` Demi Marie Obenour
2022-08-29 18:54 ` Demi Marie Obenour
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YwSEXonOg1CMzeQv@itl-email \
--to=demi@invisiblethingslab.com \
--cc=marmarek@invisiblethingslab.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.