From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202508 header.b=WKqMFI0I; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 0D7C65A0279 for ; Thu, 11 Sep 2025 04:33:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202508; t=1757557986; bh=1dKAwKedJlX4GhlKdqFMzFavUHlJmUB+7xblWzT3N0I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WKqMFI0IP4lmQTfQ37SN/54LPmUuGxXJjk3EHMlOn4U2Vq3Bl4LJoaiHF84ovgPAH /+OVrko56Jv5sOqqQO8KPNvaLyVnJj+LQPNn8niSDG61AZgUsjYtP6ZXvwt2ySxYgT Rsez/3QuK5elnrHIIW/Ojmpbn0DgEjgchXo7br2W5GGiktY3FHFAflMUpZN2U3t35v shry+VuLqEDC++fOEqCCqX3/fLGwO90kk2VzRAyhC9AtR+WaX9Yh482JzmCRRkcG6B 3QvBE9IL2zKdhXnRFtT5gzli1ebtTeRDWIoOunlg0lygCy8rDwJofvVDKImZa6/XQp SC5S1E2WHqXKw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4cMhS206Jmz4w93; Thu, 11 Sep 2025 12:33:06 +1000 (AEST) Date: Thu, 11 Sep 2025 12:31:54 +1000 From: David Gibson To: Yumei Huang Subject: Re: [PATCH v3] tcp: Store the owner connections for flags frames Message-ID: References: <20250911010936.6747-1-yuhuang@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Wzoqmsj2JMPPV2/X" Content-Disposition: inline In-Reply-To: <20250911010936.6747-1-yuhuang@redhat.com> Message-ID-Hash: PJOJJXET5HWXKRLTZ6RZ2WYHYA35IIFM X-Message-ID-Hash: PJOJJXET5HWXKRLTZ6RZ2WYHYA35IIFM X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, sbrivio@redhat.com, boleyn.su@gmail.com, v@njh.eu, jmaloy@redhat.com X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --Wzoqmsj2JMPPV2/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 11, 2025 at 09:09:36AM +0800, Yumei Huang wrote: > There is an issue reported by Volker Diels-Grabsch and Boleyn Su. > A segmentation fault occurs when executing the following command: >=20 > (sleep 0.1; ssh -p 22000 127.0.0.1) & passt -f -t 22000:22 >=20 > It's caused by commit 78da088f7bab ("tcp: unify payload and flags > l2 frames array"). Fix it by storing the owner connections of flags > frames into tcp_frame_conns[] array. >=20 > Reported-by: Volker Diels-Grabsch > Reported-by: Boleyn Su > Suggested-by: David Gibson > Fixes: 78da088f7bab ("tcp: unify payload and flags l2 frames array") > Signed-off-by: Yumei Huang Reviewed-by: David Gibson > --- > tcp_buf.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) >=20 > diff --git a/tcp_buf.c b/tcp_buf.c > index bc898de..d63c18d 100644 > --- a/tcp_buf.c > +++ b/tcp_buf.c > @@ -209,13 +209,14 @@ int tcp_buf_send_flag(const struct ctx *c, struct t= cp_tap_conn *conn, int flags) > if (ret <=3D 0) > return ret; > =20 > - tcp_payload_used++; > + tcp_frame_conns[tcp_payload_used++] =3D conn; > l4len =3D optlen + sizeof(struct tcphdr); > iov[TCP_IOV_PAYLOAD].iov_len =3D l4len; > tcp_l2_buf_fill_headers(conn, iov, NULL, seq, false); > =20 > if (flags & DUP_ACK) { > - struct iovec *dup_iov =3D tcp_l2_iov[tcp_payload_used++]; > + struct iovec *dup_iov =3D tcp_l2_iov[tcp_payload_used]; > + tcp_frame_conns[tcp_payload_used++] =3D conn; > =20 > memcpy(dup_iov[TCP_IOV_TAP].iov_base, iov[TCP_IOV_TAP].iov_base, > iov[TCP_IOV_TAP].iov_len); > --=20 > 2.47.0 >=20 --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --Wzoqmsj2JMPPV2/X Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmjCNIcACgkQzQJF27ox 2GdUnA//YsOOFIt7kHnmgRxx4v+o/E3I8mAgS4sAqTOhboK5MDXA5uNOiOTUJR/Y C85rAzJmf2FD3hb8uiuZBDsnRZzh/AkNzlZdMoKA15Pm+DE80ZEw6avH0HQSn+aQ ZjHLq/G3rebsljHIhKA6KkMsP1wuSARBlCJX3mXlJRl772fnt/YxD3lv4m5vSDWP 27f7NnjIWx0+bqO4XoEoDhza5zxYLL7QbUkEvdafp86vjLhl3uSjVhjlV+sUavZU pacocKtGgknC1wsv/jSOpBrF3QbpcFUba0XVOtB2ocaPOR2835Kxla9jycuH1rZt 7GE0kv+YSn+WH6Chj6OKKLF7iq+O9iCX2KmMA1Grx3ZgeOxGVoNPCkYPcmjvk1F/ 5LmyyvXiOTTCEk3vX6Zzpq2gPUJcV6FLx5zlMKTmptUUD5FpefFfqMN3W2zleVJV r1k5PR/gEuziDvMNgnRtmjCR3p74C2R2MceNjdjAE5dtKDdAESfZJz+IE2OlirJm iBQwVLzWQqEN1tB775LKDYLbnOAFHJQUcbpiq/RbMQKLfj9N1o/vCnSC4l1QiCTw nL8smjMrS5yCXFQdoJzABaTc/saRa/CbV4y9vFAobFjvFvaWVYm4P2WLhohhCKIk 0SwotaKn7QvsdYWuSDF6ecp0IF90vciFMcHPUnb8CeHjw326cz8= =wZie -----END PGP SIGNATURE----- --Wzoqmsj2JMPPV2/X--