From: "Robin Jarry" <rjarry@redhat.com>
To: "Vladimir Medvedkin" <vladimir.medvedkin@intel.com>, <dev@dpdk.org>
Cc: <stable@dpdk.org>
Subject: Re: [PATCH 1/2] fib6: fix memory leak on delete operation
Date: Wed, 15 Oct 2025 11:32:18 +0200 [thread overview]
Message-ID: <DDISIM2MXWBU.2A2Q7M4D9H733@redhat.com> (raw)
In-Reply-To: <20251014181755.114300-1-vladimir.medvedkin@intel.com>
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, we
> 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 == 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 <vladimir.medvedkin@intel.com>
Tested-by: Robin Jarry <rjarry@redhat.com>
--
Robin
> Use extra care when cleaning on stairs.
prev parent reply other threads:[~2025-10-15 9:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-14 18:17 Vladimir Medvedkin
2025-10-14 18:17 ` [PATCH 2/2] fib6: fix tbl8 allocation check logic Vladimir Medvedkin
2025-10-15 9:32 ` Robin Jarry
2025-10-15 9:32 ` Robin Jarry [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DDISIM2MXWBU.2A2Q7M4D9H733@redhat.com \
--to=rjarry@redhat.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
--cc=vladimir.medvedkin@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).