All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Subject: [PATCH v6 0/6] IPC fixes
Date: Thu, 25 Jun 2026 15:01:42 +0100	[thread overview]
Message-ID: <cover.1782395581.git.anatoly.burakov@intel.com> (raw)
In-Reply-To: <740b39c5098b4d40cafb9881ad70865a3c889012.1773936429.git.anatoly.burakov@intel.com>

Coverity has reported (issue ID 501503) a memory leak, but there
actually were a few more problems with IPC than that. This patchset
addresses said problems.

1. Using pointer as async request identity is unsafe

Because asynchronous requests can fail at arbitrary points while
having arbitrary number of requests or alarms already in flight,
using pointer as request identity can create use-after-free risks.
Patchset replaces this with using numeric request ID instead.

2. Alarm cancel can deadlock

Async request handler may attempt to cancel the alarm, but an alarm
might have already been in progress blocking on the same lock that
is held by async request, leading to a deadlock. Patchset removes
the alarm cancel call, and allows the alarm to fire. This is fine,
because due to fix #1 the worst that can happen from calling stale
alarm is a noop, as request ID would not be found.

3. Memory leaks

There are a couple of memory leaks in failure paths. Patchset fixes
those.

4. Zero-peer async request does not trigger alarm

When async requests are performed but no peers exist, we created
a dummy request and put it on the queue, but we never set the
dummy alarm that is supposed to handle that request. Patchset adds
the alarm set in dummy paths where none was present before.

v6:

Moved pieces around, namely:

1) apply request ID refactor first as a standalone patch
2) fix the deadlock immediately after
3) fix memory leaks next
4) add missing callback as a final step

Contents of the patchset remain the same.

Anatoly Burakov (6):
  eal: fix wrong log message in async IPC request
  eal: use request ID instead of pointers
  eal: avoid deadlock in async IPC alarm callback
  eal: fix async IPC memory leaks on partial failure
  eal: fix memory leak in async IPC secondary path
  eal: fix async IPC callback not fired when no peers

 lib/eal/common/eal_common_proc.c | 133 +++++++++++++++++++++++--------
 1 file changed, 99 insertions(+), 34 deletions(-)

-- 
2.47.3


  parent reply	other threads:[~2026-06-25 14:01 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19 16:07 [PATCH v1 1/5] eal: fix wrong log message in async IPC request Anatoly Burakov
2026-03-19 16:07 ` [PATCH v1 2/5] eal: fix async IPC callback not fired when no peers Anatoly Burakov
2026-03-19 16:07 ` [PATCH v1 3/5] eal: fix memory leak in async IPC secondary path Anatoly Burakov
2026-03-19 16:07 ` [PATCH v1 4/5] eal: fix async IPC resource leaks on partial failure Anatoly Burakov
2026-05-28 14:24   ` Thomas Monjalon
2026-05-29 15:10     ` Burakov, Anatoly
2026-03-19 16:07 ` [PATCH v1 5/5] eal: avoid deadlock in async IPC alarm callback Anatoly Burakov
2026-05-29 15:26 ` [PATCH v2 1/5] eal: fix wrong log message in async IPC request Anatoly Burakov
2026-05-29 15:26   ` [PATCH v2 2/5] eal: fix async IPC callback not fired when no peers Anatoly Burakov
2026-06-01 12:21     ` Thomas Monjalon
2026-06-01 12:40       ` Thomas Monjalon
2026-06-04 16:21         ` Burakov, Anatoly
2026-05-29 15:26   ` [PATCH v2 3/5] eal: fix memory leak in async IPC secondary path Anatoly Burakov
2026-05-29 15:26   ` [PATCH v2 4/5] eal: fix async IPC resource leaks on partial failure Anatoly Burakov
2026-06-01 12:16     ` Thomas Monjalon
2026-06-03  8:28       ` Burakov, Anatoly
2026-05-29 15:26   ` [PATCH v2 5/5] eal: avoid deadlock in async IPC alarm callback Anatoly Burakov
2026-06-04 16:32 ` [PATCH v3 1/5] eal: fix wrong log message in async IPC request Anatoly Burakov
2026-06-04 16:32   ` [PATCH v3 2/5] eal: fix async IPC callback not fired when no peers Anatoly Burakov
2026-06-05 18:15     ` Stephen Hemminger
2026-06-04 16:32   ` [PATCH v3 3/5] eal: fix memory leak in async IPC secondary path Anatoly Burakov
2026-06-04 16:32   ` [PATCH v3 4/5] eal: fix async IPC resource leaks on partial failure Anatoly Burakov
2026-06-04 16:32   ` [PATCH v3 5/5] eal: avoid deadlock in async IPC alarm callback Anatoly Burakov
2026-06-05 14:29 ` [PATCH v4 1/5] eal: fix wrong log message in async IPC request Anatoly Burakov
2026-06-05 14:29   ` [PATCH v4 2/5] eal: fix async IPC callback not fired when no peers Anatoly Burakov
2026-06-05 14:29   ` [PATCH v4 3/5] eal: fix memory leak in async IPC secondary path Anatoly Burakov
2026-06-05 14:29   ` [PATCH v4 4/5] eal: fix async IPC resource leaks on partial failure Anatoly Burakov
2026-06-05 14:29   ` [PATCH v4 5/5] eal: avoid deadlock in async IPC alarm callback Anatoly Burakov
2026-06-09  8:04     ` Burakov, Anatoly
2026-06-09 14:32       ` Stephen Hemminger
2026-06-08 13:13 ` [PATCH v5 1/5] eal: fix wrong log message in async IPC request Anatoly Burakov
2026-06-08 13:13   ` [PATCH v5 2/5] eal: fix async IPC callback not fired when no peers Anatoly Burakov
2026-06-08 13:13   ` [PATCH v5 3/5] eal: fix memory leak in async IPC secondary path Anatoly Burakov
2026-06-08 13:13   ` [PATCH v5 4/5] eal: fix async IPC resource leaks on partial failure Anatoly Burakov
2026-06-08 13:13   ` [PATCH v5 5/5] eal: avoid deadlock in async IPC alarm callback Anatoly Burakov
2026-06-25 14:01 ` Anatoly Burakov [this message]
2026-06-25 14:01   ` [PATCH v6 1/6] eal: fix wrong log message in async IPC request Anatoly Burakov
2026-06-25 14:01   ` [PATCH v6 2/6] eal: use request ID instead of pointers Anatoly Burakov
2026-06-25 14:01   ` [PATCH v6 3/6] eal: avoid deadlock in async IPC alarm callback Anatoly Burakov
2026-06-25 14:01   ` [PATCH v6 4/6] eal: fix async IPC memory leaks on partial failure Anatoly Burakov
2026-06-25 14:01   ` [PATCH v6 5/6] eal: fix memory leak in async IPC secondary path Anatoly Burakov
2026-06-25 14:01   ` [PATCH v6 6/6] eal: fix async IPC callback not fired when no peers Anatoly Burakov
2026-06-26 10:33 ` [PATCH v7 0/6] IPC fixes Anatoly Burakov
2026-06-26 10:33   ` [PATCH v7 1/6] eal: fix wrong log message in async IPC request Anatoly Burakov
2026-06-26 10:33   ` [PATCH v7 2/6] eal: use request ID instead of pointers Anatoly Burakov
2026-06-26 10:33   ` [PATCH v7 3/6] eal: avoid deadlock in async IPC alarm callback Anatoly Burakov
2026-06-26 10:33   ` [PATCH v7 4/6] eal: fix async IPC memory leaks on partial failure Anatoly Burakov
2026-06-26 10:34   ` [PATCH v7 5/6] eal: fix memory leak in async IPC secondary path Anatoly Burakov
2026-06-26 10:34   ` [PATCH v7 6/6] eal: fix async IPC callback not fired when no peers Anatoly Burakov

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=cover.1782395581.git.anatoly.burakov@intel.com \
    --to=anatoly.burakov@intel.com \
    --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 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.