All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cen Zhang (Microsoft)" <blbllhy@gmail.com>
To: sdf.kernel@gmail.com
Cc: AutonomousCodeSecurity@microsoft.com, blbllhy@gmail.com,
	bpf@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	horms@kernel.org, kuba@kernel.org, kys@microsoft.com,
	linux-kernel@vger.kernel.org, maciej.fijalkowski@intel.com,
	magnus.karlsson@intel.com, netdev@vger.kernel.org,
	pabeni@redhat.com, sdf@fomichev.me,
	tgopinath@linux.microsoft.com
Subject: Re: [PATCH net] xsk: fix NULL pointer dereference in __xsk_rcv()
Date: Fri, 24 Jul 2026 23:00:26 -0400	[thread overview]
Message-ID: <20260725030026.191412-1-blbllhy@gmail.com> (raw)
In-Reply-To: <amPqFHJBnDEQGmOK@devvm7509.cco0.facebook.com>

> ... which means they are "lost"?

You are right. The UMEM frames already consumed from the Fill Ring must
be recycled into free_list when the packet cannot be completed. 

Since the current loop calls __xsk_rcv_zc_safe(), and therefore
xp_release(), after every allocation, they cannot simply be recycled
after a later failure. I will rework v2 as a two-stage transaction:
first allocate and stage all required buffers, recycling all staged
buffers if any allocation fails; then run the error-free
copy/submit/release loop only after the allocation stage succeeds.

Thanks.

      reply	other threads:[~2026-07-25  3:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24 16:47 [PATCH net] xsk: fix NULL pointer dereference in __xsk_rcv() Cen Zhang (Microsoft)
2026-07-24 22:45 ` Stanislav Fomichev
2026-07-25  3:00   ` Cen Zhang (Microsoft) [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=20260725030026.191412-1-blbllhy@gmail.com \
    --to=blbllhy@gmail.com \
    --cc=AutonomousCodeSecurity@microsoft.com \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf.kernel@gmail.com \
    --cc=sdf@fomichev.me \
    --cc=tgopinath@linux.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.