From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=HS63MZ7G; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 2B5B95A0279 for ; Wed, 10 Sep 2025 11:25:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757496343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XlHwRU/neiC36iyk0fFZAHFG5X0I+gW0x+hGKwu9QmE=; b=HS63MZ7GDbJP4EGaLS7Xd7B9qFNxdKbMk1ONK7Q5p+dH5CpEypFzTaVkllDyDVd8Ud8IhD 4MpPs3KFy8TT/lIVaIenNCWEZFCgsCZRaG3kN0dRIXZBU4JQmgopDlaZl6t59XUN9N6cQv z8vKJ5FdL835dQUKAT1sVL8oFWtRWxs= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-332-EhOJhm9iPqSe4aZFWXoWCQ-1; Wed, 10 Sep 2025 05:25:41 -0400 X-MC-Unique: EhOJhm9iPqSe4aZFWXoWCQ-1 X-Mimecast-MFC-AGG-ID: EhOJhm9iPqSe4aZFWXoWCQ_1757496341 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-621839f460cso5308603a12.2 for ; Wed, 10 Sep 2025 02:25:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757496340; x=1758101140; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XlHwRU/neiC36iyk0fFZAHFG5X0I+gW0x+hGKwu9QmE=; b=JYdbWQwbozGq+tA6YJJQddfqVhciRGID5rZNxbRP6Y6gvVbnAqcYzNS0IDwxADkfiU E+C+/GQAMzieQbxCPtgFjfJUdpVjbZpYcfNzOxLr03e+8gnjOFE6pXseqHaQOWzhBZO0 MIUrm6HN3VsiO+Yv00UpjoYN6C89j689yfxKpG2z/Zw8MyXQfYpoCBA3gcPC69jYAwSI tb0s4V7N4O+bZMEy9rUPmcokTTi4AIL4Bi9yBLBnsQ42vObyuWLiTN2oFa5h5gQJLAVk csBaM+THULynwhJQdpnFbUn6zP0BJpQZmw0wiRnEBkY0ETU862NzvLm74KpYogGV54U2 uKFg== X-Gm-Message-State: AOJu0YzNl+wGlYUu2TSBMIpVTHNTUZc0o6Y5bzKjLnVGgzaai4zJ3nkV 3QJF8iQmh+eTOU035wq33XpOlGkARd+cUbfbMfB00qGkCGvBUjz6HkrNDhdXYVU1jpZVtZsyETO 7AnZ9wdXk+RmuG4ooEx0dlST45OdrILMgKzXuTOJ36I0PqsBfOVZQpuGZ1lueFG1nSD9KY48u42 VgHbocZkgXzoeYycRyquXo/RJ9VuGUX0S1lFWn X-Gm-Gg: ASbGncsApsAiB8yOCs5M6AuuimnF3twAQAgW2EHhEXjpWgsTwyRQ/ChGmZxmKP7WBO7 uvEMLcVm5JNoLI3mQMK2P+MbmbtcC7LcV8vQPV9GRv0oeJCsUASY9ihX2qpV2V8g3Arg3D8ifSB eW+9vvVgsDCKX1Y/v0volItQ== X-Received: by 2002:a05:6402:5c8:b0:623:d0f1:b029 with SMTP id 4fb4d7f45d1cf-623d0f1bdc8mr12822497a12.21.1757496340132; Wed, 10 Sep 2025 02:25:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELT1w2ZouOPe+fqNLKfKnUwhCwaefT7qY62ufTEo02MP/cff5ieeHo6RREQ3Pa0uV0oFGWOZ9KAlms8IAtQls= X-Received: by 2002:a05:6402:5c8:b0:623:d0f1:b029 with SMTP id 4fb4d7f45d1cf-623d0f1bdc8mr12822475a12.21.1757496339699; Wed, 10 Sep 2025 02:25:39 -0700 (PDT) MIME-Version: 1.0 References: <20250910074630.20879-1-yuhuang@redhat.com> <20250910105227.661c2d9b@elisabeth> In-Reply-To: <20250910105227.661c2d9b@elisabeth> From: Yumei Huang Date: Wed, 10 Sep 2025 17:25:28 +0800 X-Gm-Features: AS18NWAVb-kJ1U0DiXhIth03TYnHgrjWGIg7Buip1pLrCd3noBwSp4h7VYEYV8w Message-ID: Subject: Re: [PATCH] tcp: Add flags frames to payload frames arrays To: Stefano Brivio X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: AVcSsA8SA5a_xOWIxgbTeXvbzMy4NNpEqYhP056Yrc0_1757496341 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: STNXPNTGYKA6JHIVSD3OYP67JERXRV7R X-Message-ID-Hash: STNXPNTGYKA6JHIVSD3OYP67JERXRV7R X-MailFrom: yuhuang@redhat.com 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, David Gibson , Volker Diels-Grabsch , Boleyn Su , Jon Maloy 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: Thank you Stefano for all the information. I will send a v2 soon. On Wed, Sep 10, 2025 at 4:52=E2=80=AFPM Stefano Brivio = wrote: > > On Wed, 10 Sep 2025 15:46:30 +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: > > > > (sleep 0.1; ssh -p 22000 127.0.0.1) & passt -f -t 22000:22 > > > > It's caused by commit 78da088f7bab ("tcp: unify payload and flags > > l2 frames array"). Fix it by adding flags frames to payload frames > > arrays. > > Ouch. Nice catch! > > I guess in this sentence you meant "Fix it by setting ownership > information for flags frames"? The patch itself looks correct, the > commit message doesn't entirely match it though. > > The commit title is also a bit mismatching. The description for > tcp_frame_conns[] is: > > /* References tracking the owner connection of frames in the tap outqueue= */ > > A couple of minor details you probably didn't know about: > > - in this case we would typically use all these tags in the commit > message: > > Reported-by: Volker Diels-Grabsch > Reported-by: Boleyn Su > Fixes: 78da088f7bab ("tcp: unify payload and flags l2 frames array") > > - you should Cc: Jon as the author of the faulty commit (I just did) > > - David's upstream email address is david@gibson.dropbear.id.au (I just > changed it) > > I can add the tags for you, but it's probably easier if you re-post a > v2 with a more accurate commit message. Thanks! > > > Signed-off-by: Yumei Huang > > --- > > tcp_buf.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/tcp_buf.c b/tcp_buf.c > > index bc898de..d351c20 100644 > > --- a/tcp_buf.c > > +++ b/tcp_buf.c > > @@ -209,13 +209,14 @@ int tcp_buf_send_flag(const struct ctx *c, struct= tcp_tap_conn *conn, int flags) > > if (ret <=3D 0) > > return ret; > > > > - 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); > > > > if (flags & DUP_ACK) { > > struct iovec *dup_iov =3D tcp_l2_iov[tcp_payload_used++]; > > + tcp_frame_conns[tcp_payload_used - 1] =3D conn; > > > > memcpy(dup_iov[TCP_IOV_TAP].iov_base, iov[TCP_IOV_TAP].io= v_base, > > iov[TCP_IOV_TAP].iov_len); > > -- > Stefano > --=20 Thanks, Yumei Huang