vhost: reset metadata cache when initializing new IOTLB
authorJason Wang <jasowang@redhat.com>
Wed, 8 Aug 2018 03:43:04 +0000 (11:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Aug 2018 05:46:09 +0000 (07:46 +0200)
commit59f9f2c76fe16026f293d87ae6001f80ccab420b
tree2b79dea4f4f562581f0127c29f61a87c374e7d5b
parente125b1cc673adc14290a9c820ab2a27b3a7f75ec
vhost: reset metadata cache when initializing new IOTLB

[ Upstream commit b13f9c6364373a1b9f71e9846dc4fb199296f926 ]

We need to reset metadata cache during new IOTLB initialization,
otherwise the stale pointers to previous IOTLB may be still accessed
which will lead a use after free.

Reported-by: syzbot+c51e6736a1bf614b3272@syzkaller.appspotmail.com
Fixes: f88949138058 ("vhost: introduce O(1) vq metadata cache")
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/vhost/vhost.c