]> git.ipfire.org Git - thirdparty/libvirt.git/commit
rpc: Fix crash on error paths of message dispatching
authorPeter Krempa <pkrempa@redhat.com>
Fri, 4 Jan 2013 15:15:04 +0000 (16:15 +0100)
committerCole Robinson <crobinso@redhat.com>
Mon, 28 Jan 2013 19:11:49 +0000 (14:11 -0500)
commitb5a34d96ff776dd1e6d2689df05cccc217bdf3e2
tree393b62abd63e27a5c54b097ee12828d53956d488
parentbebe5122b9af50f0b25f47f30e240f4a72e9b8ca
rpc: Fix crash on error paths of message dispatching

This patch resolves CVE-2013-0170:
https://bugzilla.redhat.com/show_bug.cgi?id=893450

When reading and dispatching of a message failed the message was freed
but wasn't removed from the message queue.

After that when the connection was about to be closed the pointer for
the message was still present in the queue and it was passed to
virNetMessageFree which tried to call the callback function from an
uninitialized pointer.

This patch removes the message from the queue before it's freed.

* rpc/virnetserverclient.c: virNetServerClientDispatchRead:
    - avoid use after free of RPC messages
(cherry picked from commit 46532e3e8ed5f5a736a02f67d6c805492f9ca720)

Conflicts:
src/rpc/virnetserverclient.c
src/rpc/virnetserverclient.c