summary refs log tree commit diff stats
path: root/linux-user/openrisc/cpu_loop.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-11-06 15:13:23 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-11-10 15:07:53 +0100
commit5c75f3adbbfcdf8fae6e74875b44efb8d928974a (patch)
treea4a505288b3fa853c28f6edddefbe5d3c1fca74c /linux-user/openrisc/cpu_loop.c
parent4ded9bb54ceefeb68e766fe9aafc10de934c4501 (diff)
downloadfocaccia-qemu-5c75f3adbbfcdf8fae6e74875b44efb8d928974a.tar.gz
focaccia-qemu-5c75f3adbbfcdf8fae6e74875b44efb8d928974a.zip
slirp: fork_exec(): create and connect child socket before fork()
Currently fork_exec() fork()s, and then creates and connects the
child socket which it uses for communication with the parent in
the child process. This is awkward because the child has no
mechanism to report failure back to the parent, which might end
up blocked forever in accept(). The child code also has an issue
pointed out by Coverity (CID 1005727), where if the qemu_socket()
call fails it will pass -1 as a file descriptor to connect().

Fix these issues by moving the creation of the child's end of
the socket to before the fork(), where we are in a position to
handle a possible failure.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'linux-user/openrisc/cpu_loop.c')
0 files changed, 0 insertions, 0 deletions