summaryrefslogtreecommitdiff
path: root/gdb-xml/power64-core.xml
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2021-03-09 14:05:41 +0100
committerKevin Wolf <kwolf@redhat.com>2021-03-19 10:15:06 +0100
commit0f418a207696b37f05d38f978c8873ee0a4f9815 (patch)
tree5a84de8ab7c9bd27702deaa0ef1a177bd627649d /gdb-xml/power64-core.xml
parent3663dca461131f7c8e58737feba8638e064bb5d4 (diff)
downloadqemu-0f418a207696b37f05d38f978c8873ee0a4f9815.zip
curl: Disconnect sockets from CURLState
When a curl transfer is finished, that does not mean that CURL lets go of all the sockets it used for it. We therefore must not free a CURLSocket object before CURL has invoked curl_sock_cb() to tell us to remove it. Otherwise, we may get a use-after-free, as described in this bug report: https://bugs.launchpad.net/qemu/+bug/1916501 (Reproducer from that report: $ qemu-img convert -f qcow2 -O raw \ https://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img \ out.img ) (Alternatively, it might seem logical to force-drop all sockets that have been used for a state when the respective transfer is done, kind of like it is done now, but including unsetting the AIO handlers. Unfortunately, doing so makes the driver just hang instead of crashing, which seems to evidence that CURL still uses those sockets.) Make the CURLSocket object independent of "its" CURLState by putting all sockets into a hash table belonging to the BDRVCURLState instead of a list that belongs to a CURLState. Do not touch any sockets in curl_clean_state(). Testing, it seems like all sockets are indeed gone by the time the curl BDS is closed, so it seems like there really was no point in freeing any socket just because a transfer is done. libcurl does invoke curl_sock_cb() with CURL_POLL_REMOVE for every socket it has. Buglink: https://bugs.launchpad.net/qemu/+bug/1916501 Signed-off-by: Max Reitz <mreitz@redhat.com> Message-Id: <20210309130541.37540-3-mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'gdb-xml/power64-core.xml')
0 files changed, 0 insertions, 0 deletions