Skip to content
Snippets Groups Projects
  1. Oct 09, 2018
    • Marc-André Lureau's avatar
      tests/check-qjson: fix a leak · 8b8fa995
      Marc-André Lureau authored
      
      Spotted by ASAN:
      =================================================================
      ==11893==ERROR: LeakSanitizer: detected memory leaks
      
      Direct leak of 1120 byte(s) in 28 object(s) allocated from:
          #0 0x7fd0515b0c48 in malloc (/lib64/libasan.so.5+0xeec48)
          #1 0x7fd050ffa3c5 in g_malloc (/lib64/libglib-2.0.so.0+0x523c5)
          #2 0x559e708b56a4 in qstring_from_str /home/elmarco/src/qq/qobject/qstring.c:66
          #3 0x559e708b4fe0 in qstring_new /home/elmarco/src/qq/qobject/qstring.c:23
          #4 0x559e708bda7d in parse_string /home/elmarco/src/qq/qobject/json-parser.c:143
          #5 0x559e708c1009 in parse_literal /home/elmarco/src/qq/qobject/json-parser.c:484
          #6 0x559e708c1627 in parse_value /home/elmarco/src/qq/qobject/json-parser.c:547
          #7 0x559e708c1c67 in json_parser_parse /home/elmarco/src/qq/qobject/json-parser.c:573
          #8 0x559e708bc0ff in json_message_process_token /home/elmarco/src/qq/qobject/json-streamer.c:92
          #9 0x559e708d1655 in json_lexer_feed_char /home/elmarco/src/qq/qobject/json-lexer.c:292
          #10 0x559e708d1fe1 in json_lexer_feed /home/elmarco/src/qq/qobject/json-lexer.c:339
          #11 0x559e708bc856 in json_message_parser_feed /home/elmarco/src/qq/qobject/json-streamer.c:121
          #12 0x559e708b8b4b in qobject_from_jsonv /home/elmarco/src/qq/qobject/qjson.c:69
          #13 0x559e708b8d02 in qobject_from_json /home/elmarco/src/qq/qobject/qjson.c:83
          #14 0x559e708a74ae in from_json_str /home/elmarco/src/qq/tests/check-qjson.c:30
          #15 0x559e708a9f83 in utf8_string /home/elmarco/src/qq/tests/check-qjson.c:781
          #16 0x7fd05101bc49 in test_case_run gtestutils.c:2255
          #17 0x7fd05101bc49 in g_test_run_suite_internal gtestutils.c:2339
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20180901211917.10372-1-marcandre.lureau@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      8b8fa995
  2. Oct 08, 2018
  3. Oct 07, 2018
    • Gavin Grant's avatar
      slirp: Propagate host TCP RST packet to the guest after socket disconnected · 93a972f8
      Gavin Grant authored
      
      Commit 27d92ebc handled the case where the TCP
      connection is abruptly closed via a RST packet, by checking for the ECONNRESET
      errno. However it does not consider the case where the connection has been
      half-closed by the host (FIN/ACK), then the host socket is disconnected. For
      example, if the host application calls close() on the socket, then the
      application exits.
      
      In this case, the socket still exists due to the file descriptor in SLIRP, but
      it is disconnected. recv() does not indicate an error since an orderly socket
      close has previously occurred. The socket will then be stuck in FIN_WAIT_2,
      until the peer sends FIN/ACK or a timeout occurs. Instead we can send a RST
      to the peer and transition to the CLOSED state.
      
      Signed-off-by: default avatarGavin Grant <gavingrant@protonmail.com>
      Signed-off-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
      93a972f8
    • Andrew Oates's avatar
      slirp: fix ICMP handling on macOS hosts · 3d090aef
      Andrew Oates authored
      
      On Linux, SOCK_DGRAM+IPPROTO_ICMP sockets give only the ICMP packet when
      read from.  On macOS, however, the socket acts like a SOCK_RAW socket
      and includes the IP header as well.
      
      This change strips the extra IP header from the received packet on macOS
      before sending it to the guest.  SOCK_DGRAM ICMP sockets aren't
      supported on other BSDs, but we enable this behavior for them as well to
      treat the sockets the same as raw sockets.
      
      Signed-off-by: default avatarAndrew Oates <aoates@google.com>
      Signed-off-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
      3d090aef
Loading