From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 4FF27A0679 for ; Fri, 5 Apr 2019 02:03:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0992F1B3D7; Fri, 5 Apr 2019 02:03:52 +0200 (CEST) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 3E46F1B3B5 for ; Fri, 5 Apr 2019 02:03:47 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id e6so2048515pgc.4 for ; Thu, 04 Apr 2019 17:03:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=wy4U3zIT9wlw8a91bQIdZX+MkjkVht/yBk/hLnV2N7s=; b=EVxGJMiXEMxJ+sE5afO6UecXKnrEEz64vZQ2Ynwv/n+SogG0ZWRQc54CnukjxSw1AQ Bhf0kPt6vbdUdCh8YeZfXYbgBCZmxkNf7g6IOpBo2JqW/5cYtoSKJ5KJjQAeg3Fid1K8 pTlc0FU+rAhVkkcvkNJKzJE2dvvyTp4r7qCjpwHt6tyKhMPgnB3foUilG+gP2JmNnmZK qOmya1QgRxxK3XD35bpQU1GeR2s9AKIDGolJBXyamvnH9FG2Wi2vlfWtXt7l+dxI5q+N aw+hW47UsHBWvo+tqr01b0sg7KRDFn5t37toxoqH83gR91EJ88W1s/MnIb5bywlyjEVn J0+Q== 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; bh=wy4U3zIT9wlw8a91bQIdZX+MkjkVht/yBk/hLnV2N7s=; b=DFhLaSSxiI6Lq5HV7BYB2YpSWxa/3irpJbQlr8sC/z4hfRDBGcfuRs6sIsvstPp7AX L83bQkP+ryQOyr0r401aQZXlnP+S63yT254UePMuQW6NiKcn6Tjud+FvB/KM3HM2VuKQ RIO8xfVDIVgJ7wi2/YHix71znCOI9/qt9sUSriIpEvvLKldaL8WykxNOhh5ao+L8OHfp 2XJZAksxkadGJNQzh3M89LinRDRdRPkbFNqDPZj3FN008GVQ6s5Ho1nXSbjc/Uv6y7wb 9wNF0yX3aLI7mekAIjkxrAf0PKyRM9tv4M1WZEaWnXXUb1JrsUgJTkFNbLOg70MfvkVm tjdQ== X-Gm-Message-State: APjAAAVEJsWIVhVRLIxxMgmQQquk5wIa8z/G0fyTMil7JuGyMPP1dYTF Hv1T84mLD4Ytl0+Vol25ahPW+g== X-Google-Smtp-Source: APXvYqxju5IugQa+4j/pL5hyKEM0yB62O+3r55dp2YeicfSgZaniJQC/hBElLpmxz/+omxZ8kQFrMg== X-Received: by 2002:a63:7843:: with SMTP id t64mr8332167pgc.178.1554422626193; Thu, 04 Apr 2019 17:03:46 -0700 (PDT) Received: from localhost.localdomain ([167.220.104.255]) by smtp.gmail.com with ESMTPSA id v6sm24866814pgv.92.2019.04.04.17.03.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Apr 2019 17:03:44 -0700 (PDT) From: Stephen Hemminger To: maxime.coquelin@redhat.com Cc: dev@dpdk.org, stable@dpdk.org, Stephen Hemminger Date: Thu, 4 Apr 2019 17:03:43 -0700 Message-Id: <20190405000343.24424-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-stable] [PATCH] virtio: fix buffer leak on vlan insert X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" The function rte_vlan_insert may allocate a new buffer for the vlan header and return a different mbuf than originally passed. In this case, the stored mbuf in txm[] array could point to wrong buffer. Fixes: dd856dfcb9e7 ("virtio: use any layout on Tx") Signed-off-by: Stephen Hemminger --- drivers/net/virtio/virtio_rxtx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index e6f3706d6fe1..2ae4232c181d 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -2003,6 +2003,8 @@ virtio_xmit_pkts_packed(void *tx_queue, struct rte_mbuf **tx_pkts, rte_pktmbuf_free(txm); continue; } + /* vlan_insert may add a header mbuf */ + tx_pkts[nb_tx] = txm; } /* optimize ring usage */ -- 2.17.1