From: Stefan Hajnoczi <stefanha@redhat.com> Date: 2016-08-04 13:52:53
Stash the packet length in a local variable before handing over
ownership of the packet to virtio_transport_recv_pkt() or
virtio_transport_free_pkt().
This patch solves the use-after-free since pkt is no longer guaranteed
to be alive.
Reported-by: Dan Carpenter <redacted>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
drivers/vhost/vsock.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
From: "Michael S. Tsirkin" <mst@redhat.com> Date: 2016-08-04 16:34:44
On Thu, Aug 04, 2016 at 02:52:53PM +0100, Stefan Hajnoczi wrote:
Stash the packet length in a local variable before handing over
ownership of the packet to virtio_transport_recv_pkt() or
virtio_transport_free_pkt().
This patch solves the use-after-free since pkt is no longer guaranteed
to be alive.
Reported-by: Dan Carpenter <redacted>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Thanks!
I'd prefer a lower-case prefix, mentioning vhost, such as vhost/vsock.
I'll tweak it for now.
From: Stefan Hajnoczi <stefanha@redhat.com> Date: 2016-08-05 08:52:31
On Thu, Aug 04, 2016 at 07:34:43PM +0300, Michael S. Tsirkin wrote:
On Thu, Aug 04, 2016 at 02:52:53PM +0100, Stefan Hajnoczi wrote:
quoted
Stash the packet length in a local variable before handing over
ownership of the packet to virtio_transport_recv_pkt() or
virtio_transport_free_pkt().
This patch solves the use-after-free since pkt is no longer guaranteed
to be alive.
Reported-by: Dan Carpenter <redacted>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Thanks!
I'd prefer a lower-case prefix, mentioning vhost, such as vhost/vsock.
I'll tweak it for now.
Thanks, I will use vhost/vsock in the future.
Stefan