VFIO fixes for v4.18

- Fix deadlock in mbochs sample driver (Alexey Khoroshilov)
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJbSMhRAAoJECObm247sIsindIQAI3R+3QGXWn8TO/ipJEW4aEs
 BPaXbsCjbUt5K+CbkcpQEUMluy2A9yHdyEKDMqTbEinycUw2EsVpE/eu5qz1M5nZ
 sWRvbDza8tuS52d7OZchRoGVltIkm1mMHCeVYYiy2RgIRMYFjCFB4efbDV7Pznrp
 HhVAvBmv0i0Mk+nqNmK9wJn0sGiU/n5Qw5k57oQfUjsaFSyGVDTP2A7EAzn/F3YU
 AH2DMN0Dn0BiVtS/pKKXQP6mx3UvBuiONphgSWDE4Lfv+gEhUNYsjjMK9qWkuHFO
 w1evHGgPN4AGdZu/SSv4Hqnv3Y341DgQ/jRQVKt/BH72Ffqf/6qv/ahA2gPOCjmd
 808gkuJlnVWUt8MqJdo4oDQu+9P3nnMoNoY1uN6LkLgMl1m9knVPS/fFGXxhF7/M
 KLCGovQRXBq8+L0JJ2BP/++SuSmnE5t6dKdjkW+AF38UbZzrRZs94baYx5gUfG4q
 kQv2dl3Z6XZxzxdjFr4uOqHgY4rmzey8zn6RkPBPpdlZ1zl+XWnJYvwhdv1kBwRj
 VZjiKZZFgIegCinQ2ynjEg/bLiwHeXBgFSja1bcmfu5ikup4NgXp+ExhYYdKpbkG
 9H7GS19et74GUk2LzdtlXLK+rRlGduBsMBuMJ/kHpfE7uoKWa66tMmZ22xNPhe9c
 jG+tU9dORicFp2WNA0O7
 =hKUs
 -----END PGP SIGNATURE-----

Merge tag 'vfio-v4.18-rc5' of git://github.com/awilliam/linux-vfio

Pull VFIO fix from Alex Williamson:
 "Fix deadlock in mbochs sample driver (Alexey Khoroshilov)"

* tag 'vfio-v4.18-rc5' of git://github.com/awilliam/linux-vfio:
  sample: vfio-mdev: avoid deadlock in mdev_access()
This commit is contained in:
Linus Torvalds 2018-07-13 12:37:45 -07:00
commit 2a7e1211e1
1 changed files with 3 additions and 1 deletions

View File

@ -178,6 +178,8 @@ static const char *vbe_name(u32 index)
return "(invalid)";
}
static struct page *__mbochs_get_page(struct mdev_state *mdev_state,
pgoff_t pgoff);
static struct page *mbochs_get_page(struct mdev_state *mdev_state,
pgoff_t pgoff);
@ -394,7 +396,7 @@ static ssize_t mdev_access(struct mdev_device *mdev, char *buf, size_t count,
MBOCHS_MEMORY_BAR_OFFSET + mdev_state->memsize) {
pos -= MBOCHS_MMIO_BAR_OFFSET;
poff = pos & ~PAGE_MASK;
pg = mbochs_get_page(mdev_state, pos >> PAGE_SHIFT);
pg = __mbochs_get_page(mdev_state, pos >> PAGE_SHIFT);
map = kmap(pg);
if (is_write)
memcpy(map + poff, buf, count);