From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [DPDK/core Bug 1700] BPF callback wait is not MP safe
Date: Fri, 25 Apr 2025 22:47:29 +0000 [thread overview]
Message-ID: <bug-1700-3@http.bugs.dpdk.org/> (raw)
[-- Attachment #1: Type: text/plain, Size: 1374 bytes --]
https://bugs.dpdk.org/show_bug.cgi?id=1700
Bug ID: 1700
Summary: BPF callback wait is not MP safe
Product: DPDK
Version: 25.03
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: minor
Priority: Normal
Component: core
Assignee: dev@dpdk.org
Reporter: stephen@networkplumber.org
Target Milestone: ---
The mechanism implemented in bpf_pkt.c is like an open coded version of
seqlock.
There is an inherit race because:
If the CPU running the callback doesn't reach the before the count
is executed, it can rance with the CPU doing destroy.
CPU 1: CPU 2:
bpf_eth_unload()
bc = bpf_eth_cbh_find()
bpf_rx_callback_vm (or
bpf_rx_callback_jit)
rte_eth_remove_rx_callback()
bpf_eth_cbi_unload(bc)
bpf_eth_cbi_wait(bc)
at this point bc->inuse == 0 because call back not started
but is going to be used by CPU 2. And calling rte_bpf_destroy
will lead to use after free.
There is no good way to fix this without using RCU.
Also, the code should be consistently using C11 atomic not barriers.
Not sure if anyone ever uses this code anyway!
--
You are receiving this mail because:
You are the assignee for the bug.
[-- Attachment #2: Type: text/html, Size: 3237 bytes --]
reply other threads:[~2025-04-25 22:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=bug-1700-3@http.bugs.dpdk.org/ \
--to=bugzilla@dpdk.org \
--cc=dev@dpdk.org \
/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).