mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-29 22:07:43 +09:00
[ Upstream commitc38e39c378] vhost_net_ubuf_put_and_wait has a confusing name: it will actually also free it's argument. Thus since commit1280c27f8e"vhost-net: flush outstanding DMAs on memory change" vhost_net_flush tries to use the argument after passing it to vhost_net_ubuf_put_and_wait, this results in use after free. To fix, don't free the argument in vhost_net_ubuf_put_and_wait, add an new API for callers that want to free ubufs. Acked-by: Asias He <asias@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>