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=ZS6xuqfb; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id D87015A0279 for ; Wed, 10 Sep 2025 10:52:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757494360; 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=ABrwyWkTRHOuVBfxjpmD0bnaw4x9ep6tzpdzoC6/GqM=; b=ZS6xuqfbXEBkvum8u/6ApoO8mePldXdnkj3+Pq+L7eIs9JgfLUVRh0CfzKTuDE6o4PAgyr e3VnJIatiUq/coP1PvO0kQ7B595JBf8WL+hjS9erl2RvtIaUSd7tRuh6vpm/mmc+/NHFL4 0Vv4gdvz8+SWn720HSgYNGPDJtkqD60= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-395-ssgO7WwHO0KKZPqm8s7hAA-1; Wed, 10 Sep 2025 04:52:38 -0400 X-MC-Unique: ssgO7WwHO0KKZPqm8s7hAA-1 X-Mimecast-MFC-AGG-ID: ssgO7WwHO0KKZPqm8s7hAA_1757494357 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-45cb6d8f42bso63682885e9.2 for ; Wed, 10 Sep 2025 01:52:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757494357; x=1758099157; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ABrwyWkTRHOuVBfxjpmD0bnaw4x9ep6tzpdzoC6/GqM=; b=dUt0u5Y0PIOuSSfWVv1a4UaMpyOpWlo8ZIRFFZI/k8pV6CaJZNDmcc6jrNl/7qGuoi w0mDh76ysLzRH/tKcttH4ZKpLOmzwy0S5I/C6wLh4WTKrhRFwAGU+tYi01l60uFdLYXK SawdWnuzA6MUbS4M4HKKwoeZpS9My8/x3JDWPrT/8wRlhi6T9iOBPrr4HpnzZD0MzuJ2 dbI1rQNY/yhAhwsFq4HhuzEmD5XTQ13haiVqrzFkREEVci375AqcSpelcAAB0RDLj1Eg CLD4Gz4uu1gfbndPPePOyWA7eL2l5p6vXYXkJQ93Ldom3aBt1YvWNS44oVwwH7AAOWk8 7GnA== X-Gm-Message-State: AOJu0Yzx4sOOvnYR9vMoR0PVqvHk+7U4HQqV/NqstThrd7I8pP5+Qybc BRnC+lXz06FYpso93t84jqj9nsBvt27ylQYyOWk5CzSxh3PDE90qGDZvtL7cBlZbcjq5v12u+d/ 5FR15uEiPRXjrvuF6pTIclaFRq15n8U/G3S09CEdGjQE4ArGHOdwwLg== X-Gm-Gg: ASbGnctJFOVDA6ntZlJ5p1q+FI0nX1/6mrgwhuXt8UvAXfh+pHCMEoQJm4aYsEHNzAL Fi6hSWkOf6MdyIw5nlb91JdHggQ2FR4S+ig4CkAuKReAdtapexmp7gEW6esscC0pG+SOk/qB7Yk 03nxJa3PL1s9DH7cetnpYN+9KQjpnGXhKB/kGzchMrJu37hI5k36yqngShckQyVN0qqLGU9hf2x SWI80TBVpJ8tFu3ezDXyig5HQzOjp4vo1MdoZALx8WGhFuHF11il4eoCgEcN2sGB/cH0KwnO+f5 l507eE1e9WcXcOu3+Gqtmadq7F5lV+WVzBLyAI6VTpAOx/NXPqg= X-Received: by 2002:a05:6000:2013:b0:3e2:c41c:b2e2 with SMTP id ffacd0b85a97d-3e643ff70d8mr11155133f8f.39.1757494357340; Wed, 10 Sep 2025 01:52:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYa0TvqwRAvkQrAOzjuYkJCyhf1HiK5x9fHOj3QSpizx9efbXPmpPBwtXbEfgyv8lVkf0yZA== X-Received: by 2002:a05:6000:2013:b0:3e2:c41c:b2e2 with SMTP id ffacd0b85a97d-3e643ff70d8mr11155112f8f.39.1757494356897; Wed, 10 Sep 2025 01:52:36 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45df821932asm19555635e9.13.2025.09.10.01.52.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Sep 2025 01:52:36 -0700 (PDT) Date: Wed, 10 Sep 2025 10:52:35 +0200 From: Stefano Brivio To: Yumei Huang Subject: Re: [PATCH] tcp: Add flags frames to payload frames arrays Message-ID: <20250910105227.661c2d9b@elisabeth> In-Reply-To: <20250910074630.20879-1-yuhuang@redhat.com> References: <20250910074630.20879-1-yuhuang@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: SLgACBp-Q9cGgytKdWLlSdcUeE11RFYsPvpYY0HLjf0_1757494357 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: A5WI6D55MHG3RFMEUW5AEQ4WQDPJUXUL X-Message-ID-Hash: A5WI6D55MHG3RFMEUW5AEQ4WQDPJUXUL X-MailFrom: sbrivio@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: 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 <= 0) > return ret; > > - tcp_payload_used++; > + tcp_frame_conns[tcp_payload_used++] = conn; > l4len = optlen + sizeof(struct tcphdr); > iov[TCP_IOV_PAYLOAD].iov_len = l4len; > tcp_l2_buf_fill_headers(conn, iov, NULL, seq, false); > > if (flags & DUP_ACK) { > struct iovec *dup_iov = tcp_l2_iov[tcp_payload_used++]; > + tcp_frame_conns[tcp_payload_used - 1] = conn; > > memcpy(dup_iov[TCP_IOV_TAP].iov_base, iov[TCP_IOV_TAP].iov_base, > iov[TCP_IOV_TAP].iov_len); -- Stefano