From: Michael S. Tsirkin Date: Tue, 25 Jun 2013 14:29:46 +0000 (+0300) Subject: vhost-net: fix use-after-free in vhost_net_flush X-Git-Tag: v3.11-rc1~47^2~9 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c38e39c378f46f00ce922dd40a91043a9925c28d;p=pandora-kernel.git vhost-net: fix use-after-free in vhost_net_flush vhost_net_ubuf_put_and_wait has a confusing name: it will actually also free it's argument. Thus since commit 1280c27f8e29acf4af2da914e80ec27c3dbd5c01 "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 Acked-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- Reading git-diff-tree failed