aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-02-18m_cleanup: fix memory leaksmemory_leaksjeremy marchand1-0/+12
m_cleanup didn't cleanup the if_batchq and if_fastq queues, resulting in a memory leak (reported by ASAN while fuzzing).
2021-02-18Merge branch 'ndp-leak' into 'master'Samuel Thibault1-0/+3
ip6_output: fix memory leak on fast-send See merge request slirp/libslirp!67
2021-02-18ip6_output: fix memory leak on fast-sendndp-leakSamuel Thibault1-0/+3
When emitting NDP Neighbour Sollicitations, ip6_output immediately calls if_encap without going through any queue. if_encap however does not free the mbuf, so ip6_output has to do it. This was leaking one mbuf per NDP NS sent by slirp. Hopefully the guest was not using more than NDP_TABLE_SIZE (16) IPv6 addresses, in which case it was limited to a bound number, but more addresses would result to leaks.
2021-02-16Merge branch 'reject-ipv6-addr-any' into 'master'Samuel Thibault1-0/+8
Reject host forwarding to ipv6 "addr-any" See merge request slirp/libslirp!66
2021-02-16Reject host forwarding to ipv6 "addr-any"Doug Evans1-0/+8
Libslirp currently only provides a stateless DHCPv6 server, and thus can't do the "addr-any -> guest IP address" translation that is done for ipv4. Until a stateful DHCPv6 server is available, reject addr-any. Signed-off-by: Doug Evans <dje@google.com>
2021-02-11Merge branch 'memset-sizeof' into 'master'Samuel Thibault1-2/+2
tcpx_listen: Pass sizeof(addr) to memset See merge request slirp/libslirp!65
2021-02-11tcpx_listen: Pass sizeof(addr) to memsetDoug Evans1-2/+2
Signed-off-by: Doug Evans <dje@google.com>
2021-02-11Complete timeout documentationSamuel Thibault1-1/+1
2021-02-11Document the slirp APISamuel Thibault1-9/+55
2021-02-03Merge branch 'ipv6-host-fwd-9-patch' into 'master'Samuel Thibault7-44/+191
Add ipv6 host forward support See merge request slirp/libslirp!62
2021-02-03Add ipv6 host forward supportDoug Evans7-44/+191
Two exported functions are added which are the ipv6 versions of their ipv4 counterparts: slirp_add_ipv6_hostfwd, slirp_remove_ipv6_hostfwd. Signed-off-by: Doug Evans <dje@google.com>
2021-01-29tcp_subr: simplify codeSamuel Thibault1-1/+1
This is actually similar to the fix in 9f78e94912f9 ("Fix a typo that can cause slow socket response on Windows."), except that here there is no semantic change since s = so->s above. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2021-01-29Merge branch 'socket_delay' into 'master'Samuel Thibault1-1/+1
[PATCH] Fix a typo that can cause slow socket response on Windows. See merge request slirp/libslirp!64
2021-01-29[PATCH] Fix a typo that can cause slow socket response on Windows.Hafiz Abid Qadeer1-1/+1
We observed slow responses on a host forwarded port on Windows. Investigation revealed that qemu_fd_register was being called with fd=-1 and this caused g_poll in qemu_poll_ns timing out. I tracked this behavior to following commit: 748f8f4 slirp: replace qemu_set_nonblock() @@ -482,7 +483,8 @@ void tcp_connect(struct socket *inso) tcp_close(sototcpcb(so)); /* This will sofree() as well */ return; } - qemu_set_nonblock(s); + slirp_set_nonblock(s); + so->slirp->cb->register_poll_fd(so->s); It seems that calling register_poll_fd with so->s instead of s may be a typo. Changing it back to s solves this issue. The commit 748f8f4 made similar change in tcp_fconnect but I have not touched it. Signed-off-by: Hafiz Abid Qadeer <abidh@codesourcery.com>
2021-01-23Merge branch 'unused' into 'master'Samuel Thibault1-2/+0
Fix unused variables See merge request slirp/libslirp!63
2021-01-24Fix unused variablesMarc-André Lureau1-2/+0
../../subprojects/libslirp/src/slirp.c:131:17: error: unused variable 'old_stat' [-Werror,-Wunused-variable] struct stat old_stat; ^ ../../subprojects/libslirp/src/slirp.c:143:10: error: unused variable 'buff' [-Werror,-Wunused-variable] char buff[512]; ^ 2 errors generated. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-01-20Merge branch 'master' into 'master'Samuel Thibault1-0/+8
fork_exec_child_setup: improve signal handling See merge request slirp/libslirp!61
2021-01-20fork_exec_child_setup: improve signal handlingNathaniel Wesley Filardo1-0/+8
Blocked signal state is inherited across exec(), so let's zero that out rather than inherit whatever it was when we spawned the child. POSIX has some strange rules about SIG_IGN'd SIGCHLD across exec, so let's not do that, just for consistency.
2020-12-04Merge branch 'void' into 'master'Samuel Thibault7-18/+18
Remove some needless (void)casts See merge request slirp/libslirp!60
2020-12-04Remove some needless (void)castsMarc-André Lureau7-18/+18
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-12-02changelog: post-releaseMarc-André Lureau1-0/+11
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-12-02Merge branch '4.4.0-release' into 'master'Marc-André Lureau2-5/+15
Release v4.4.0 See merge request slirp/libslirp!59
2020-12-02Release v4.4.0v4.4.0Marc-André Lureau2-5/+15
2020-12-01Merge branch 'consume-empty-packet' into 'master'Samuel Thibault1-3/+0
socket: consume empty packets See merge request slirp/libslirp!55
2020-12-01socket: consume empty packetsGiuseppe Scrivano1-3/+0
it fixes a tightloop when a packet with len==0 is received. Closes: https://github.com/rootless-containers/slirp4netns/issues/227 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-11-27Merge branch 'errors' into 'master'Samuel Thibault6-6/+96
Enable forwarding ICMP errors See merge request slirp/libslirp!49
2020-11-27Merge branch 'ttl' into 'master'Samuel Thibault3-0/+45
udp, udp6, icmp: handle TTL value See merge request slirp/libslirp!48
2020-11-27Merge branch 'CVE-2020-29129' into 'master'Samuel Thibault2-0/+8
slirp: check pkt_len before reading protocol header See merge request slirp/libslirp!57
2020-11-27slirp: check pkt_len before reading protocol headerPrasad J Pandit2-0/+8
While processing ARP/NCSI packets in 'arp_input' or 'ncsi_input' routines, ensure that pkt_len is large enough to accommodate the respective protocol headers, lest it should do an OOB access. Add check to avoid it. CVE-2020-29129 CVE-2020-29130 QEMU: slirp: out-of-bounds access while processing ARP/NCSI packets -> https://www.openwall.com/lists/oss-security/2020/11/27/1 Reported-by: Qiuhao Li <Qiuhao.Li@outlook.com> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> Message-Id: <20201126135706.273950-1-ppandit@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-11-27Merge branch 'qemu' into 'master'Marc-André Lureau3-70/+6
Remove the QEMU-special make build-system See merge request slirp/libslirp!56
2020-11-27Remove the QEMU-special make build-systemMarc-André Lureau3-70/+6
Since QEMU 5.2, QEMU uses meson and handle the build itelf before it starts using libslirp as a subproject. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-11-27Merge branch 'master' into 'master'Marc-André Lureau3-41/+43
meson: support compiling as subproject See merge request slirp/libslirp!53
2020-10-19Merge branch 'ios-support' into 'master'Marc-André Lureau2-3/+108
Add DNS resolving for iOS See merge request slirp/libslirp!54
2020-10-12Add DNS resolving for iOSosy2-3/+108
iOS does not support reading /etc/resolv.conf so we have to use libresolv Also modified build script to support building on Darwin systems.
2020-09-14meson: support compiling as subprojectPaolo Bonzini2-23/+33
Skip installation of devel files if compiling as a subproject, including the library if a static version is available; the parent project can force usage of the (installed) shared library using default_library=shared. An option can also be used to customize the SLIRP_VERSION_STRING and ascertain if the parent project is using the embedded version of slirp. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-14meson: remove meson-dist scriptPaolo Bonzini2-20/+12
Unfortunately meson subprojects do not support add_dist_script, so we cannot generate the .tarball-version file at "meson dist" time. Include the version in the meson project declaration, and use build-aux/git-version-gen only to determine SLIRP_VERSION_STRING. Instead of the dist script, we check that the version in the project declaration matches the latest tag. If they do not match it will be impossible to run "ninja dist" successfully. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-31Merge branch 'coverity' into 'master'Marc-André Lureau1-0/+18
.gitlab-ci: add a Coverity stage See merge request slirp/libslirp!51
2020-08-27Merge branch 'G_GNUC_PRINTF' into 'master'Samuel Thibault1-0/+1
Add G_GNUC_PRINTF to local function slirp_vsnprintf See merge request slirp/libslirp!52
2020-08-27Add G_GNUC_PRINTF to local function slirp_vsnprintfStefan Weil1-0/+1
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-08-19sosendoob: better document what urgc is used forSamuel Thibault1-3/+4
2020-08-18.gitlab-ci: add a Coverity stageMarc-André Lureau1-0/+18
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-08-18TCPIPHDR_DELTA: Fix potential negative valueSamuel Thibault1-2/+2
sizeof() returns a size_t so the tcpiphdr / ip+tcphdr difference will be a size_t and always be >= 0, while this intended to detect the difference getting < 0. This is actually a no-op with the current code because it currently has tcpiphdr bigger than ip+tcphdr. Spotted by Coverity: CID 212435. Spotted by Coverity: CID 212440. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2020-07-19udp, udp6, icmp, icmp6: Enable forwarding errors on LinuxSamuel Thibault2-1/+76
Not all icmp errors are reported as errno errors. Linux however lets us get them through a message error queue. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2020-07-19icmp, icmp6: Add icmp_forward_error and icmp6_forward_errorSamuel Thibault4-5/+20
They work like icmp_send_error and icmp6_send_error but allow to specify the source IP address Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2020-07-19udp, udp6, icmp: handle TTL valueSamuel Thibault3-0/+45
For traceroute and such, we need to handle the TTL value like a router. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2020-07-17Merge branch 'lp1878043' into 'master'Samuel Thibault1-1/+1
ip_stripoptions use memmove See merge request slirp/libslirp!47
2020-07-17ip_stripoptions use memmoveDr. David Alan Gilbert1-1/+1
ip_stripoptions is moving data long in the same buffer; that's undefined with memcpy, use memmove. Buglink: https://bugs.launchpad.net/qemu/+bug/1878043 Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2020-07-08changelog: post-releaseMarc-André Lureau1-0/+11
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-08Merge branch 'release-v4.3.1' into 'master'v4.3.1Marc-André Lureau3-7/+12
Release v4.3.1 See merge request slirp/libslirp!46
2020-07-08Release v4.3.1Marc-André Lureau3-7/+12