diff options
| author | Steven Luo | 2016-04-07 07:04:32 +0200 |
|---|---|---|
| committer | Samuel Thibault | 2016-04-07 10:27:42 +0200 |
| commit | bfb1ac14029ee72b19296109fba880c0551755d5 (patch) | |
| tree | 270d62cb3221dc7f5353f8e7d5198ec1d98fb295 /slirp/socket.h | |
| parent | slirp: don't crash when tcp_sockclosed() is called with a NULL tp (diff) | |
| download | qemu-bfb1ac14029ee72b19296109fba880c0551755d5.tar.gz qemu-bfb1ac14029ee72b19296109fba880c0551755d5.tar.xz qemu-bfb1ac14029ee72b19296109fba880c0551755d5.zip | |
slirp: avoid use-after-free in slirp_pollfds_poll() if soread() returns an error
Samuel Thibault pointed out that it's possible that slirp_pollfds_poll()
will try to use a socket even after soread() returns an error, resulting
in an use-after-free if the socket was removed while handling the error.
Avoid this by refusing to continue to work with the socket in this case.
Signed-off-by: Steven Luo <steven+qemu@steven676.net>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'slirp/socket.h')
| -rw-r--r-- | slirp/socket.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/slirp/socket.h b/slirp/socket.h index e9c9b053dc..7dca506973 100644 --- a/slirp/socket.h +++ b/slirp/socket.h @@ -127,7 +127,7 @@ struct socket *solookup(struct socket **, struct socket *, struct socket *socreate(Slirp *); void sofree(struct socket *); int soread(struct socket *); -void sorecvoob(struct socket *); +int sorecvoob(struct socket *); int sosendoob(struct socket *); int sowrite(struct socket *); void sorecvfrom(struct socket *); |
