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 15FE21B6E1 for ; Fri, 10 Nov 2017 14:54:34 +0100 (CET) Received: by mail-wm0-f67.google.com with SMTP id g141so2887997wmg.2 for ; Fri, 10 Nov 2017 05:54:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ftVzMjFiGeAdvE45RWH3H4qLyUX+H+CcpFiJotVIAv0=; b=UV6zjoDcl/oc2x1B+xab68pyqKQADd05YwQ67LX7z0MDCMmRfNpDucGJQdSiYEsTxg GeVBJ7FSnm2hI58Nf/P3Jmr/3SPbz5X14bJAZiK/i0IidHtX1zW37pQ7fiumQ5SlR6xK AN4uTVp2h5+bEKj+d7LQy8UWoq7lXbNwKpTHp6M0lUSs47MAfkma0sCODe3v7nMp+803 01jxvCZVomOyCG7IsvgyY8HJpE0XlzviWc9eN/OZBMHC12sxwLsVdBHbuporz6yOZj30 t3TkCvGke0xTwrLiZeZEjy7pcwwBMmvcaZft93qUOGwmYpVL/ECi6Fi/kRGiGk2Q0I2w tbsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ftVzMjFiGeAdvE45RWH3H4qLyUX+H+CcpFiJotVIAv0=; b=g98J3xXnV0d/Bd6SAXH7mPlauvxFmj4CobQsH/rZ4oKqRVDMqa1Nygacj99omG4hEE TUrBpkXNwaShW8LqJwv0/XCDlWGy47MwlDhleiqANQ1cZbVr2QwdIMoMyZ8kSAyxG3j9 dJk/t2Eb9TQH39dZgu/vUKDZqhUFyjuWEhjm9noTSIyrCb7EUEjycDZAM3y8r1U3lYud JK9Ww3NtcA1C8cbjB6gy3VnvMG/wS81JFmitLR3dATKVIki9wziri9Tyvp0UyZyGjCp3 uyv2gjr5fo/XaTh7W3bOqogwNDjg1NXe2YbcooZNYPnWCnioyl/LqgH6ppr1Zd1q//Kf tYXQ== X-Gm-Message-State: AJaThX45WnUos0htPyYN+B3ksPwQk/Hu210+MNINd4rZp0k7ltwpwp7z j8cw/KIumUxmJ1Jm61+JD2AU7vUD X-Google-Smtp-Source: AGs4zMYTjduDaa1/adl5+RQhQXmWcSmIxpAZJpdTsgmgNwKri8fuN5hr0J9qsYe5JHN+/SS+Uw6Yrw== X-Received: by 10.28.199.139 with SMTP id x133mr273235wmf.145.1510322073486; Fri, 10 Nov 2017 05:54:33 -0800 (PST) Received: from xone.net.sahm.ae ([94.205.75.192]) by smtp.gmail.com with ESMTPSA id e71sm2323608wma.13.2017.11.10.05.54.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Nov 2017 05:54:32 -0800 (PST) From: "Ilya V. Matveychikov" To: dev@dpdk.org Cc: "Ilya V . Matveychikov" Date: Fri, 10 Nov 2017 16:54:28 +0300 Message-Id: <20171110135428.23940-1-matvejchikov@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: References: Subject: [dpdk-dev] [PATCH 1/4] 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: Fri, 10 Nov 2017 13:54:34 -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 != m_dup) rte_pktmbuf_free(seg); rte_pktmbuf_free(m_dup); return NULL; } -- 2.7.4