From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 445841B6A6 for ; Thu, 9 Nov 2017 14:49:27 +0100 (CET) Received: by mail-wm0-f67.google.com with SMTP id y80so17206716wmd.0 for ; Thu, 09 Nov 2017 05:49:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=50cTo0+M96ucXCYqmCQUgS1Kgs4vJEmmDSZOJHH0qbc=; b=YxP/5hcMDNT8dKcEQjAbWOZDBxyY1DPku6Ku7NYZ2FFGhn9SJcPkFiKCT0PwJGOY4b tcRmosQ48A0MDsP9RQc4SLg1g0nw7DmDZqdipW7xNwQxIt14y5JgfHS5NJqayiysoMNs V3+F9JF2sb7KKlI6d5Dvdq5MucdraknY9S/oPd4jntlA1uajHw1Y+Xvty02bjA+NuS6F IQWJ9ke0+VVV/35O2UytcoqzrYUSgjcJjpkrpoMkj1KXOSfJ9SdqNDH0SYBSvrFdTKgq uOIWYavXzWzKsP2eK4k+mW6dx4V+umH9/mT6W22tm0d6NgnydcTZHi83Mc37jRIxUWda 60+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=50cTo0+M96ucXCYqmCQUgS1Kgs4vJEmmDSZOJHH0qbc=; b=bs3ouWbCn1AgxFCkzSrRP+BoasGfSF7EXu7RjQLrNMkbDK0Et6e0z1K0d55cXahCWx kZCVK6zJU5zXqs2g9Fgkse8lKqAdV/+tZhx4e0dXVEEk9h2oWi5Zlaje4v8U9NjsGx66 pRlc1pl2oGMdbmWQxcQpYWBaZC7yRKgvHLvZi/TcJJwoCp+3ery/JNsnQsnZBNL0EpaT 6nJrOlwpKhMupglRefkPZxpLfCRJBYUUBQC6Z6biGv/kbvrIyilBDg25dEQSY8OhvUkF C8X7z/1LbtPaX+i3uDUx6rgmeekpznah5CUZR1PffuEnLzaQp+xIX3JJ20tkwmhuHMa8 fbtQ== X-Gm-Message-State: AJaThX7aovBEQqo39jeay34GwB7ZpoOU99BrsGvBUUMaI5J5Izl6uogB cpFQyUj8pgLA4J6NuinKOKzl0S6M X-Google-Smtp-Source: ABhQp+QhHE/FLCoQshFSpfjyN32Z3quDWuGgG2L9sp0LLnRweS2DkdSEKpI/YKJeQI0SpngWTn49SQ== X-Received: by 10.80.137.82 with SMTP id f18mr751671edf.202.1510235366804; Thu, 09 Nov 2017 05:49:26 -0800 (PST) Received: from [10.61.0.167] (bba193485.alshamil.net.ae. [217.165.96.191]) by smtp.gmail.com with ESMTPSA id i10sm6141132edl.34.2017.11.09.05.49.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2017 05:49:26 -0800 (PST) From: Ilya Matveychikov Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Message-Id: Date: Thu, 9 Nov 2017 17:49:24 +0400 To: dev@dpdk.org X-Mailer: Apple Mail (2.3273) Subject: [dpdk-dev] [PATCH] pdump: fix possible mbuf leak X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 13:49:27 -0000 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: 278f9454 ("pdump: add new library for packet capture") Signed-off-by: Ilya V. Matveychikov --- lib/librte_pdump/rte_pdump.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c index 729e79a..1ca709d 100644 --- a/lib/librte_pdump/rte_pdump.c +++ b/lib/librte_pdump/rte_pdump.c @@ -153,6 +153,7 @@ pdump_pktmbuf_copy(struct rte_mbuf *m, struct = rte_mempool *mp) do { nseg++; if (pdump_pktmbuf_copy_data(seg, m) < 0) { + if (seg !=3D m_dup) rte_pktmbuf_free(seg); rte_pktmbuf_free(m_dup); return NULL; } -- 2.7.4=