From: "Ilya V. Matveychikov" <matvejchikov@gmail.com>
To: dev@dpdk.org
Cc: "Ilya V. Matveychikov" <matvejchikov@gmail.com>, reshma.pattan@intel.com
Subject: [dpdk-dev] [PATCH] pdump: fix possible mbuf leak
Date: Fri, 10 Nov 2017 16:55:16 +0300 [thread overview]
Message-ID: <20171110135516.23996-1-matvejchikov@gmail.com> (raw)
In-Reply-To: <E85600CB-CC62-41CA-B265-3A480F129051@gmail.com>
If pdump_pktmbuf_copy_data() fails it's possible to have segment leak
as rte_pktmbuf_free() only handles m_dup chain but not the seg just
allocated and yet not chained.
Fixes: 278f945402c5 ("pdump: add new library for packet capture")
Cc: reshma.pattan@intel.com
Signed-off-by: Ilya V. Matveychikov <matvejchikov@gmail.com>
---
lib/librte_pdump/rte_pdump.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c
index e6182d35c..fec49b525 100644
--- a/lib/librte_pdump/rte_pdump.c
+++ b/lib/librte_pdump/rte_pdump.c
@@ -153,6 +153,8 @@ pdump_pktmbuf_copy(struct rte_mbuf *m, struct rte_mempool *mp)
do {
nseg++;
if (pdump_pktmbuf_copy_data(seg, m) < 0) {
+ if (seg != m_dup)
+ rte_pktmbuf_free_seg(seg);
rte_pktmbuf_free(m_dup);
return NULL;
}
--
2.14.2
next prev parent reply other threads:[~2017-11-10 13:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 13:49 Ilya Matveychikov
2017-11-09 18:41 ` Ferruh Yigit
2017-11-10 13:54 ` [dpdk-dev] [PATCH 1/4] " Ilya V. Matveychikov
2017-11-10 13:55 ` Ilya V. Matveychikov [this message]
2017-11-12 3:13 ` [dpdk-dev] [PATCH] " Thomas Monjalon
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=20171110135516.23996-1-matvejchikov@gmail.com \
--to=matvejchikov@gmail.com \
--cc=dev@dpdk.org \
--cc=reshma.pattan@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).