From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0768848941 for ; Wed, 15 Oct 2025 11:32:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 00BC8402AB; Wed, 15 Oct 2025 11:32:25 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 00373402AB for ; Wed, 15 Oct 2025 11:32:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760520742; 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=hDnjADbkZ0R1pgXz/mlZ7yxQKxqiz5uLZCFxoKqads8=; b=d2boP75L9zN9bhTryyyupU1ojuRcQyVZpbKk1V2fWZu/VJJnJIiksiupQyn0J6t7aST+9B cBJO8aJI01M2NHJc66G0t1EZ9AAWQM+U7+4fmLtzH8LSV4MEXORnQQHcgOeng1faPRm/ev Io9RXlGRPbz/bBQM1UN1WxQfDF11K5Y= 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-333-VHW4Ubo2Nk6Ie1QlUm7gyQ-1; Wed, 15 Oct 2025 05:32:21 -0400 X-MC-Unique: VHW4Ubo2Nk6Ie1QlUm7gyQ-1 X-Mimecast-MFC-AGG-ID: VHW4Ubo2Nk6Ie1QlUm7gyQ_1760520740 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-46e38957979so32785585e9.3 for ; Wed, 15 Oct 2025 02:32:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760520740; x=1761125540; h=in-reply-to:references:user-agent:subject:to:from:cc:message-id :date:content-transfer-encoding:mime-version:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hDnjADbkZ0R1pgXz/mlZ7yxQKxqiz5uLZCFxoKqads8=; b=tgrBDfApwc2ZMCgTfI3geAvcZsD0jXw8k2NRKJKBfusEo9zZiwe9/rnk/H6kcKfdm1 B40Ni68QAFM2jyy9R/nnRXfFBLez/3yilW4URsUPfkTxWri1lu16YeTPLBkQefaIMt35 HRyYWGbyIlV6Jb0ptFCn0Hc6qEjALjXy084Vg/KmOvoJzlnoz60No6efikDneFsMmrwx YGmipwUMRkYZReBT0qAnxfOlNBjtRx7k8tJehCUM1ijC0q/nGPnXx7dsO3h0rn0nozpp sM/yMoHwjFVfpLdUhlBHG8jjlpqpoIkGD+1Ths7h7ChuZOkhfH/MunS1GENWnIQprkzC 5eRw== X-Gm-Message-State: AOJu0YyZQDq4o2QboAhtpDgbpeGjbQtGEzHdZITLygou/U+5CFQmaA1l dswK+7kxVQGf0ZZCxkRs+1KSrnGkG2hUZaxgptyK8j/sc6KEFkwUxQZ0/AQp3sh09GjWlK8lbzt IYPDh4OGWy/YIc6yqX3ZuZx3BALSVw/sU4gtHoCkbv1eOdXvF X-Gm-Gg: ASbGncsPFv/QxzOUNI+6ULmJydcixcuWUkdsmPmc5c3H8WJGm02zBj9Ims6Dwcvu1z/ sod6ea7usbPE4GrQ7SUoqyRfpwPUy2f3hrrvXLFbCQj80h7iTNRSm2h9UBWtTXJfBNIkXjFcbKb jbMQWZyhUmJ1YqhhkS6lyeT5Uc84HBlsWpliOSsPinOuu6zdAIi+LgiyFAc2LqV/oB4bwz9fILj FNK/Hh2wHBhna2eD0dQcuvs3G5eGsWky3XEn7ZXbtxh5jacMmZdEMDf3mvDWB1Hbp4mdreLHYGb OjO3JHl/i3izhFX8VVKp8QSO+QL4dcFFNgaFlkTgrJ/1oLeIlVFyRieVctuFDMpknZKE83uBcum 8fqagMs2an6qlg5e+CGrdTQ== X-Received: by 2002:a05:600c:35cf:b0:46f:b42e:e360 with SMTP id 5b1f17b1804b1-46fb42ee424mr129039775e9.40.1760520739883; Wed, 15 Oct 2025 02:32:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGenaXMx0qWBdkx/UyunBR1JSqsXIi592G9WgGTo0S3jBu4f2eb+PE0MP1XDbm6vvpJVdjnQQ== X-Received: by 2002:a05:600c:35cf:b0:46f:b42e:e360 with SMTP id 5b1f17b1804b1-46fb42ee424mr129039535e9.40.1760520739420; Wed, 15 Oct 2025 02:32:19 -0700 (PDT) Received: from localhost (2a01cb00021ec0002e23edbec21b0e73.ipv6.abo.wanadoo.fr. [2a01:cb00:21e:c000:2e23:edbe:c21b:e73]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47101c2359fsm19673825e9.11.2025.10.15.02.32.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Oct 2025 02:32:19 -0700 (PDT) Mime-Version: 1.0 Date: Wed, 15 Oct 2025 11:32:18 +0200 Message-Id: Cc: From: "Robin Jarry" To: "Vladimir Medvedkin" , Subject: Re: [PATCH 1/2] fib6: fix memory leak on delete operation User-Agent: aerc/0.21.0-9-ga57e783008e9 References: <20251014181755.114300-1-vladimir.medvedkin@intel.com> In-Reply-To: <20251014181755.114300-1-vladimir.medvedkin@intel.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Ms2-Bl2DNIHYaEtzaO9Ixcwg6uMc7Oi05ueOxfiENqc_1760520740 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Vladimir Medvedkin, Oct 14, 2025 at 20:17: > When deleting a prefix, the first attempt to get next prefix cannot > return NULL as we will at a minimum get the prefix we are trying to > delete, whereas we were rather interested in whether there are other > prefixes within the same subtree, not counting the prefix we are > deleting. To address this, we check if we have found the exact prefix we > started with, and perform another search to see if there are more > prefixes to be found. > > In addition to that, doing the searches with _COVER rather than _ALL is > incorrect, because if we are doing search with _COVER rather than _ALL, w= e > do not dive into the tree to find more specific prefixes within the > prefix we are going to delete, and thus will not notice if our subtree > also has more specific prefixes. To fix it, perform first (and > subsequent) searches with _ALL rather than _COVER. > > Finally, when we hit the "tmp =3D=3D NULL" branch (meaning, when we are > deleting the only node that exists in our subtree), we know that the > rib6_lookup will always return us the node that we are trying to delete, > but this is incorrect because further code will consider this to be our > parent node. Address this by doing another search to find the parent of > the current node. > > Fixes: c3e12e0f0354 ("fib: add dataplane algorithm for IPv6") > Cc: stable@dpdk.org > > Signed-off-by: Vladimir Medvedkin Tested-by: Robin Jarry --=20 Robin > Use extra care when cleaning on stairs.