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=Z5RLuGw0; 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 A16405A0008 for ; Fri, 02 May 2025 19:27:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1746206824; 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=ZI1Czqyj9gCMQOjNu7TXILBcajnRUVo4iAcG6SMSGdg=; b=Z5RLuGw0Bngkf070+RZSXJcKFVF/HS6bziYhKYNDSyQA+Wgy20SWj7S3Zg6sYv6+U0uTLe RUeLcITlx1+mk/TB61mvzFsYjfV61DjX536l1JIwtQq/g9cDvOZTkmvO3/t+6yGfLdPNG+ QwUPt658zjYjxI3un9r+OMCz0UqWl9I= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-646-cXovqNcnOV-RixjqwYMW4g-1; Fri, 02 May 2025 13:27:02 -0400 X-MC-Unique: cXovqNcnOV-RixjqwYMW4g-1 X-Mimecast-MFC-AGG-ID: cXovqNcnOV-RixjqwYMW4g_1746206821 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-43ced8c2eb7so17706595e9.1 for ; Fri, 02 May 2025 10:27:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746206820; x=1746811620; 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=ZI1Czqyj9gCMQOjNu7TXILBcajnRUVo4iAcG6SMSGdg=; b=bnlVQ9vObc/2wHFahBbJs4Pm/JQhc1vMCqm9xMV3H9ZxeyIJp72bN95YludLoPvTfL HQrM9WtJydaJKnu8wlNQaCDlXUKeaoEd451wFq12x4+6zfklzKhtAMnLbOw9jkJb9za+ SnpH2X3sh+IZwB4fs2gBiny2wKk0NElua3Tmm5XkYvUtD3uklBjyNhDcYUllxf+t9dib +q3KsAbEj1029z5UE6yz+AHa5XFfLZiYkmKCfXWq9X1TsUttTzZi/tPXJk1OfV1xRaSC UJ6YWOEZCHQJSiV7773itsuqpG9c6ppPlC/2So3WOrPXNg9WDKlSAth0b+AZ2aGxpiS1 cVRA== X-Gm-Message-State: AOJu0YzaPbqveRoxOJr2HKKaD3OVQz5YAyi3NaxmQyHKQY/xzFVS1tY3 Hhx3Hg2Z+QXe+99dkLLc2taQ4F8N2tlfN3IcPSNXsw8p1AsaGi5CZ0jNuXGGElDH1tR47P9YlZX 1mTLsyU08TlPjJGkf8AZEOxhTVltLX+67cC0NKWKqfmY31PMTju9dRyn42Q== X-Gm-Gg: ASbGnctHO6n9waZOGDnh5GGO2Sq/BzVaWPuilwcTnq0uYtgg5f0KfTUUMOlE+yqeFGG KPW7EshlgK09sFNrcU3P6ORxothPUIkD6fhv83tlsXgAecgYCMqKpUjSg5j4UkbBzH1zRkVsXIw fIhAcLbw2Fu5WOxTKhMcXrtUXkB9mlmnUKQE2IyIBO2DIpJAVYUtd4+MUDIkikUzx2GxH0gUF6d ko4mGs+YOGafIsH0iYrqDZoHrwb/NZAeOiGyjJBTwWkzHTPEpO/cBAEBYBk0Sthch0i4CNY22hh dbPxOoPTqI3pahoThPhDVq2TXbVScV1NNDvWM4At X-Received: by 2002:a05:600c:8012:b0:440:66a4:8d1a with SMTP id 5b1f17b1804b1-441bbe90308mr33952755e9.7.1746206820625; Fri, 02 May 2025 10:27:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGoty/C/UTrt23W1fPELbl95mslllF7SfuJr65RdR/QaNpxAxjLgMDvwO9Pk6irLU76oDZPPA== X-Received: by 2002:a05:600c:8012:b0:440:66a4:8d1a with SMTP id 5b1f17b1804b1-441bbe90308mr33952505e9.7.1746206820207; Fri, 02 May 2025 10:27:00 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a099b0feb3sm2657260f8f.67.2025.05.02.10.26.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 May 2025 10:26:59 -0700 (PDT) Date: Fri, 2 May 2025 19:26:58 +0200 From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH] flow: fix podman issue #25959 Message-ID: <20250502192658.0ac2e3f0@elisabeth> In-Reply-To: <20250430160525.3642997-1-lvivier@redhat.com> References: <20250430160525.3642997-1-lvivier@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: cG0btKu1y_XYoqCS3KSZvMGRrMzq0rSYIxxB-el5X0g_1746206821 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 3AONFIIR7DBTKFBLG6HB26FVU5HE4RRC X-Message-ID-Hash: 3AONFIIR7DBTKFBLG6HB26FVU5HE4RRC 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, Martin Rijntjes 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, 30 Apr 2025 18:05:25 +0200 Laurent Vivier wrote: > While running piHole using podman, traffic can trigger the following > assert: > > ASSSERTION FAILED in flow_alloc (flow.c:521): flow->f.state == FLOW_STATE_FREE > > Backtrace shows that this happens in flow_defer_handler(): > > #4 0x00005610d6f5b481 flow_alloc (passt + 0xb481) > #5 0x00005610d6f74f86 udp_flow_from_sock (passt + 0x24f86) > #6 0x00005610d6f737c3 udp_sock_fwd (passt + 0x237c3) > #7 0x00005610d6f74c07 udp_flush_flow (passt + 0x24c07) > #8 0x00005610d6f752c2 udp_flow_defer (passt + 0x252c2) > #9 0x00005610d6f5bce1 flow_defer_handler (passt + 0xbce1) > > We are trying to allocate a new flow inside the loop freeing them. > > Inside the loop free_head points to the first free flow entry in the > current cluster. But if we allocate a new entry during the loop, > free_head is not updated and can point now to the entry we have just > allocated. > > We can fix the problem by spliting the loop in two parts: > - first part where we can close some of them and allocate some new > flow entries, > - second part where we free the entries closed in the previous loop > and we aggregate the free entries to merge consecutive the clusters. > > Link: https://github.com/containers/podman/issues/25959 > Signed-off-by: Laurent Vivier Applied, thanks! -- Stefano