All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Chen Zhao <ch3nzhao@gmail.com>
Cc: weh@microsoft.com, thomas@monjalon.net, dev@dpdk.org,
	stable@dpdk.org, dpdklab@iol.unh.edu
Subject: Re: [PATCH] net/netvsc: fix event buffer leak on realloc failure
Date: Sun, 25 Oct 2026 08:55:48 -0700	[thread overview]
Message-ID: <20261025085548.3f5c7e31@phoenix.local> (raw)
In-Reply-To: <20261025021802.3343047-1-ch3nzhao@gmail.com>

On Sun, 25 Oct 2026 02:18:02 +0000
Chen Zhao <ch3nzhao@gmail.com> wrote:

> Hi,
> 
> The AI review reports a double-free and a dangling event_buf:
> https://mails.dpdk.org/archives/test-report/2026-October/1069492.html
> 
> Both findings are false positives:
> 
> 1. On successful reallocation, goto retry skips rte_free(old_buf).
>    The retry label is outside the ENOBUFS block. Each subsequent entry
>    into that block reinitializes old_buf from the current event_buf,
>    so a later allocation failure frees the current allocation, not an
>    address retained from a previous successful reallocation.
> 
> 2. On failure, rte_realloc() returns NULL without freeing the old buffer.
>    That NULL return value has already been assigned to rxq->event_buf
>    before rte_free(old_buf) is reached. Thus event_buf is already NULL;
>    no additional NULL assignment is needed.
> 
> The patch preserves the existing reset-and-retry behavior while freeing
> the old allocation on failure.
> 
> Thanks,
> Chen

The CI AI model is still using to weak a model and I never believe anything it says

  reply	other threads:[~2026-10-25 15:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-25  1:46 [PATCH] net/netvsc: fix event buffer leak on realloc failure Chen Zhao
2026-10-25  2:18 ` Chen Zhao
2026-10-25 15:55   ` Stephen Hemminger [this message]
2026-10-26 16:58 ` Stephen Hemminger
     [not found] ` <20261029165452.966911-1-ch3nzhao@gmail.com>
2026-10-29 19:43   ` [PATCH v2] " Stephen Hemminger

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=20261025085548.3f5c7e31@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=ch3nzhao@gmail.com \
    --cc=dev@dpdk.org \
    --cc=dpdklab@iol.unh.edu \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=weh@microsoft.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.